Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 18th, 2005, 02:49 PM
Authorized User
 
Join Date: Feb 2004
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Default mistake in code

Hello all guru's
Can any one help please
this is my code and by the on my form i dont use data source so all the fields that i need will call from my vb codes
strlink = "[tblUserSecurity_Sec.recid]=" & me.recid
or this one
strlink = "[tblUserSecurity_Sec.recid]=" & Me![tblUserSecurity_Sec.recid]

Best Regards,
Hamed Gholamian
 
Old February 18th, 2005, 04:23 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Hi,

   If you are trying to pass a text box or combo box value to a query (report based on a query), then you would use this syntax:

strLink = "[QueryFieldName] = " & Me.TextBoxOrComboBoxName

Please note the space between the = and the "

Also, make sure that if you are using a combo box from your form, that you have bound it to the right column. It should be bound to the same column as the QueryFieldName you are passing.

HTH


mmcdonal
 
Old February 23rd, 2005, 06:00 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

The space between the = and the " is not the issue. If you're trying to pass a string (i.e. text), then your statement should look like this (note the use of single quotes ' as delimiters):

strLink = "[QueryFieldName] = '" & Me.TextBoxOrComboBoxName & "'"

If the field holds a date then,

dtmLink = "[QueryFieldName] = #" & Me.TextBoxOrComboBoxName & "#"

And if the field holds a number (e.g. integer), you don't need anything

intLink = "[QueryFieldName] = " & Me.TextBoxOrComboBoxName


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old February 24th, 2005, 04:04 PM
Authorized User
 
Join Date: Feb 2004
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks guys for your help i manage to fix it but dont ask how :) well with the help of one my friends but as soon as it is finish i will upload so every one can use it (well it helped me alot)

Best Regards,
Hamed Gholamian

Last edited by yami56; May 6th, 2011 at 09:02 AM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Did you find a mistake? nzakas BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 47 July 18th, 2006 05:51 PM
Mistake in code on page 151 MythicalMe BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 May 22nd, 2006 01:11 PM
mistake in my topics zakarya_hazara Classic ASP Basics 1 October 9th, 2004 02:49 AM
Dangerous mistake revinchalil SQL Server 2000 4 February 4th, 2004 12:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.