DoCmd.Openreport?

  • Thread starter Thread starter MJJ
  • Start date Start date
M

MJJ

I open a report based on a query with the DoCmd.OpenReport
and put a filter on it such as:
"(IsNull(Rounds) OR Rounds = 0) And (IsNull(PreDB_Num) Or
PreDb_Num=0)"

But it is listing all the records instead of the ones I
want. I put this string in a variable and put the
variable at the end of the DoCmd. What's wrong here?
 
You need an extra comma, so your filter becomes the WhereCondition of
OpenReport:

Dim strWhere As String
strWhere = "(IsNull(Rounds) OR Rounds = 0) And (IsNull(PreDB_Num) Or
PreDb_Num=0)"
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
 
-----Original Message-----
I open a report based on a query with the DoCmd.OpenReport
and put a filter on it such as:
"(IsNull(Rounds) OR Rounds = 0) And (IsNull(PreDB_Num) Or
PreDb_Num=0)"

But it is listing all the records instead of the ones I
want. I put this string in a variable and put the
variable at the end of the DoCmd. What's wrong here?


.
Never Mind, I found the Dumb mistake!
 
Back
Top