combo box

robart6

Registered User.
Local time
Today, 17:21
Joined
Feb 11, 2004
Messages
19
Please help a newbie!

I have a form with a combo box. When the user selects a name from the combo box, I want a new form to open with the record corresponding to the name from the combo box. I know how to do this when the combo box resides on the same form as the corresponding record but need to do it on two separate forms.

All help will be greatly appreciated!
 
DoCmd.OpenForm "YourFormName", acNormal, , "[YourFieldName] = Forms!YourFormName!YourFieldName"

;)
 
Syntax correction:
DoCmd.OpenForm "frmYourFormName", acNormal, , "[YourFieldName] =" & Me.cboFieldName

This assumes that frmYourFieldName is the form you want to open, YourFieldName is the name of the field in that form's recordsource that you want to match to the value in the combo box, and that cboFieldName is the name of the combo box on the open form. It also assumes that cboFieldName contains numeric data.
 
Dan-Cat, thank you very much for the prompt reply and successful statement.
 
Thanks, dcs693. Your statement, using Me! instead of Forms!, also works. I appreciate the help.
 

Users who are viewing this thread

Back
Top Bottom