finding a record in a table from a form

smartenuk

Registered User.
Local time
Today, 10:11
Joined
May 14, 2010
Messages
18
I am desperate at this point, I have looked everywhere and I know it is something simple but I need help. I am a novice at access and am trying this because no one else will.

I am in a form that uses a table and I need to look up a record that matches a particular field. The table is "tblVolunteers" the table key is "Volunteers_ID" and I need to find a record whose key matches text box "VolID". Any help would be appreciated
 
I need to do the lookup "on Load" of the form.
 
There would be no value in the textbox when the form loaded, so no way for it to filter. If the value comes from a different form, the first option should work.
 
thanks again. I did look up your page and I have tried them with no luck yet.
 
If you get stuck, post your code and the relevant data types.
 
I get the error message " The expression you entered refers to an object that is closed or doesn't exist"
 
is there some way I can send you what I have, posting it has too much in it
 
Well, you didn't post the code, but presumably the form you're referring to in it isn't open.
 
Likely all I need is the code this bit is in, and what object it's in.
 
I am trying this
DoCmd.GoToRecord "Volunteer_ID" = Me.volid
volid is a number that I need the table to go to
 
btw, the value I am trying to use as the lookup key, VolID is a tempvar
 
Bookmark looks as my best chance. how do I code this line:
lngBookmark = Me.[TempVars]![VolID]
 
I haven't used TempVars, but it looks like the syntax is

lngBookmark = TempVar!VolID
 
tried it as you wrote and also replaced the tempvar with a txtField and still couldn't get it to work, but thanks a lot for the effort. Still have to get this done by Monday.
 
Hard to help when you don't post the code. Or the db.
 
Thank You, Thank You. You saved my life with the BOOKMARK app. I was up most of the night troubleshooting the code only to finally find that I had a fat-finger hiccup in your answer causing the errors. Once I moved the tempvar to a txt file it worked.
 
Glad it worked for you!
 
@smartenuk,
You made this much harder than you needed to. Paul's first suggestion to use an unbound combo and let Access build it was essentially a no code colution.
 

Users who are viewing this thread

Back
Top Bottom