DoCmd.OpenForm help

CoffeeGuru

Registered User.
Local time
Today, 01:22
Joined
Jun 20, 2013
Messages
121
I am trying to open a form that will display only the rows in my table where two conditions are met

1 is Country Code [CountryCode]
2 is Retail Chain [Chain]

Theses are both stored on the same form I am trying to run the VBA from
so I hoped that my VBA statement would look like this....but it doesnt :mad:

Code:
DoCmd.OpenForm "frmWWLiveTbl", , , "Chain=" & [Forms]![MainMenu Country]![cboChain]

I am also unsure how to add the second Where Condition

Can anyone help me

Martin
 
So, you are opening the new form from the current form? Try this:

Code:
DoCmd.OpenForm "frmWWLiveTbl", , , "Chain=" &Me.cboChain

Make sure that cboChain is the correct control name.
 
Is "Chain" an ID field??

Sorry should be:

Code:
[CODE]DoCmd.OpenForm "frmWWLiveTbl", , , "[Chain]=" & Me.cboChain
[/CODE]
 

Users who are viewing this thread

Back
Top Bottom