DoCmd.OpenForm with multiple conditions

radshar

Registered User.
Local time
Yesterday, 22:54
Joined
Aug 5, 2016
Messages
32
Hi,
I'm trying to run a very simple VBA linked to a form. What I need is for this VBA to open up a form with multiple criteria. I've found many forums with this information however, my filter is in the same column.

Basically, my form is linked to a table where I have the column [Status]. In my VBA to return only the records "Review Pending" and "In-progress".

This formula did work:

Code:
DoCmd.OpenForm "Daily Review", acFormDS, , "Status ='Review Pending'", acFormEdit

but I can only apply the one condition "Review Pending"....I need for the data to include those records with an "In-progress" status which is in the same column...

any tips would be great!
 
Use an OR:

"Status ='Review Pending' OR Status='In-progress'"
 
Hi, welcome to the forum!!!

Code:
DoCmd.OpenForm "Daily Review", acFormDS, , "Status = 'Review Pending' [COLOR="Blue"]OR Status = 'In-progress'[/COLOR]"
 
Hi Plog and Mark,

I've tried that and I get a syntax error:

Run-time error '3075':

Syntax error in string in query expression "Status ='Review Pending' OR Status = 'In-progress".

anything else?
 
You are missing a single quote.
 
WOW...how silly of me!

thank you so much! have a great day
 

Users who are viewing this thread

Back
Top Bottom