Where Issue with DoCmd

forms_are_nightmares

Registered User.
Local time
Yesterday, 17:02
Joined
Apr 5, 2010
Messages
71
Hope someone out there can help.

I'm trying to open second form based on the criteria in the first. If I designate a single criteria, the second form opens without an issue. However, when I add a second criteria, i.e., using and, I can't get it to work. I'm hoping it's just a fundamental coding issue;

Code that works (Will open the form with the appropriate ID)

DoCmd.OpenForm "frm_priority_placed_subform", , , "[ID] = " & Me.ID

Code that fails (I get a type mismatch)
DoCmd.OpenForm "frm_priority_placed_subform", , , "[ID] = " & Me.ID And Status = "Open"

Status is text
ID is a number

Any help is appreciated
 
The quotes are simply not in the correct place in the syntax.
DoCmd.OpenForm "frm_priority_placed_subform", , , "[ID] = " & Me.ID & " And Status = 'Open' "
 
Thanks Rural Guy that did the trick.

I should change my name to quotes_are_nightmares...
 
You're welcome. How about SyntaxCanDriveYouNuts?
 

Users who are viewing this thread

Back
Top Bottom