DoCmd.OpenForm with multiple conditions (1 Viewer)

radshar

Registered User.
Local time
Yesterday, 23:37
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!
 

plog

Banishment Pending
Local time
Today, 01:37
Joined
May 11, 2011
Messages
11,676
Use an OR:

"Status ='Review Pending' OR Status='In-progress'"
 

MarkK

bit cruncher
Local time
Yesterday, 23:37
Joined
Mar 17, 2004
Messages
8,195
Hi, welcome to the forum!!!

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

radshar

Registered User.
Local time
Yesterday, 23:37
Joined
Aug 5, 2016
Messages
32
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?
 

MarkK

bit cruncher
Local time
Yesterday, 23:37
Joined
Mar 17, 2004
Messages
8,195
You are missing a single quote.
 

radshar

Registered User.
Local time
Yesterday, 23:37
Joined
Aug 5, 2016
Messages
32
WOW...how silly of me!

thank you so much! have a great day
 

Users who are viewing this thread

Top Bottom