Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 18th, 2005, 02:49 PM
Authorized User
 
Join Date: Feb 2004
Location: london, uk, United Kingdom.
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
Reply With Quote
  #2 (permalink)  
Old February 18th, 2005, 04:23 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #3 (permalink)  
Old February 23rd, 2005, 06:00 PM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
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
Reply With Quote
  #4 (permalink)  
Old February 24th, 2005, 04:04 PM
Authorized User
 
Join Date: Feb 2004
Location: london, uk, United Kingdom.
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..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:00 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.