New to VBA

moleary

Senior Member
Local time
Today, 18:13
Joined
Feb 9, 2001
Messages
58
I have a combo box in which you can select a client name and I have command buttons that go to forms but I want the form to go to the record of the name selected in the combo box how can I write a code for it to do that???
 
Look at the parameters of the OpenReport Method. You can pass the ClientId selected in the combobox to the form as it opens.
 
could you explain that in more detail, I am having a hard time understanding exactly how to go about this.
 
This is the Code you are looking for. You can also accomplish this task by using the command button wizard to 1) Open form, 2) Choose the form to open, 3) select "and go to a specific record"

I think this will help sort it out for you.

Private Sub Command1_Click()

DoCmd.OpenForm "FormWithMatchingField", acNormal, , "[MainFormFieldNameToMatch]=" & Me![MainFormFieldNameToMatch], acFormEdit

End Sub
 

Users who are viewing this thread

Back
Top Bottom