Match Record when opening a form from another form

Hey Lucy

Registered User.
Local time
Today, 15:41
Joined
Jan 20, 2012
Messages
124
I have managed to write a If statement in a macro to open another form when a checkbox is checked (for Yes) on the main form. Works like a charm...but a somewhat tarnished one...lol...in that it doesn't open to the corresponding record.

Without VB code, is there a way to do this completely through Access....I've asked a similar question before and was told it would have to be done in VB, but I'm time-constrained and don't know VB (but am trying to learn in my spare time...haa). Any suggestions, ideas? Someway to lock the record in on the 2nd form?
 
The VBA to do what you are after is very straight forward, it would look something like;
Code:
DoCmd.OpenForm "YourFormName", , , "YourLinkingID = " & Me.YourLinkingIDonForm
The above will work where your linking ID is numeric, for a text link use;
Code:
DoCmd.[URL="http://msdn.microsoft.com/en-us/library/office/ff820845.aspx"]OpenForm[/URL] "YourFormName", , , "YourLinkingID = [COLOR="Red"][B]'[/B][/COLOR]" & Me.YourLinkingIDonForm [B][COLOR="Red"]&"'"[/COLOR][/B]
Note: the highlighted additions to the code
 
Thanks so much! My link is numeric, so no problem! Again, thank you!
 

Users who are viewing this thread

Back
Top Bottom