statments in a filter

A

Afrosheen

Thanks for looking at my question.
I need a filter that will match 4 criteria. Everything must be equal to.

Here is the statement I'm using.

stwhere = "[shift] = 'A-Days' or [shift]='B-Days' or [shift] = 'Day Shift'or
[status]='Working'"

DoCmd.OpenReport stDocName, acViewPreview, , stwhere, , "A-Days Post Report"

All of that must match up then print the report. It will print on the docmd,
but it will show those on either A-days or B-days "Not Working". I just want
it to show those working.

What am I doing wrong?
 
J

John Spencer

stwhere = "([shift] = 'A-Days' or [shift]='B-Days' or [shift] = 'Day Shift')
AND [status]='Working'"

Or alternative
stwhere = "[shift] IN ('A-Days','B-Days','Day Shift') and [status]='Working'"

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top