WhereCondition ignored when MS Access Form invokes Report

  • Thread starter Thread starter yisraelharris
  • Start date Start date
Y

yisraelharris

I have a form with fields, and a button, whose onclick opens a report
using:

DoCmd.OpenReport myReportName, acViewPreview, , myWhereCondition

All is well: the report opens, and the parameters from the form appea
correctly in the report header.

However, the myWhereClause achieves nothing, and fails to cause th
appropriate records to be filtered out of the report. Any ideas as t
why?

The whereCondition is simply "fieldName = 222222". Please note that
ran a query with the exact same whereCondition (SELECT * FROM tableNam
where fieldName = 222222"), and there, it does work
 
yisraelharris said:
I have a form with fields, and a button, whose onclick opens a report,
using:

DoCmd.OpenReport myReportName, acViewPreview, , myWhereCondition

You have one comma missing in the above.

DoCmd.OpenReport myReportName, acViewPreview, , , myWhereCondition
 
Back
Top