Open form based on a query

sharpnote

Registered User.
Local time
Yesterday, 17:11
Joined
Feb 8, 2013
Messages
20
I have a form with search field which when filled up returns a particular record based on a query. Now, I wanted to open that particular record on a form where it was encoded. please help. thanks
 
Check out the Where condition of the DoCmd.OpenForm, it will look something like;


Code:
DoCmd.OpenForm "YourFormName", , ,"YourLinkingID= " & Me.YourLinkFieldOnForm
This code assumes that your link is numeric, if it is text use;
Code:
DoCmd.OpenForm "YourFormName", , ,"YourLinkingID= [B][COLOR="Red"]'[/COLOR][/B]" & Me.YourLinkFieldOnForm [B][COLOR="Red"]& "'"[/COLOR][/B]
 
Thank you John Big Booty. Though I haven't tried the code due to tremendous work load lately, I'll try this and get back to you as soon as I can. Thanks again.
 
It is working!!! Thanks a lot John Big Booty. Hope I can count on you next time around. thanks
 

Users who are viewing this thread

Back
Top Bottom