subform problems

pattyt

Registered User.
Local time
Today, 14:50
Joined
Aug 10, 2001
Messages
13
I have a field called helpno on a subform that I want to double-click on and it opens another form..I used a Macro that works fine..however I want the form that I am opening to open on the helpno record that matches from my subform...I tried using where condition on my Macro and messed up somehow...even though the forms name is spelled right and I have all the necessary brackets...I saw some examples using new Collection..others using recordSource...not sure whether to use VBA coding or modules or Macros...once I get the form opened that matches my subform helpno I'll be doing live editing...any coding help appreciated..
 
I haven't used macros for so long that I have forgotten how to use them but this code in an [Event Procedure] in the Dbl Click event of your field should do the trick:

Docmd.OpenForm "YourForm" , , , "[HelpNo] = " & Me![HelpNo]

Just replace YourForm with the name of the form you want to open and I am assuming that HelpNo is in fact a number and NOT a text field. If it is text then use this code:

Docmd.OpenForm "YourForm" , , , "[HelpNo] = '" & Me![HelpNo] & "'"
 

Users who are viewing this thread

Back
Top Bottom