Where Statment

G

Gary M Hull

I am trying to open a report from a Command Button, and Apply a Filter

The following Code is not working.

The where Statement is giving me problems

DoCmd.OpenReport "repStateRunList", acViewPreview, , (((tblContestant.
[Male/Female] Like "f")))
 
A

Allen Browne

The last argument needs to be surrounded with quotes.
Quotes inside quotes need to be doubled up.
Use the Equals operator where possible rather than the Like operator.

Try:

DoCmd.OpenReport "repStateRunList", acViewPreview, , _
"tblContestant.[Male/Female] = ""f"""
 
G

Guest

Gary M Hull said:
I am trying to open a report from a Command Button, and Apply a Filter

The following Code is not working.

The where Statement is giving me problems

DoCmd.OpenReport "repStateRunList", acViewPreview, , (((tblContestant.
[Male/Female] Like "f")))
 
Top