Syntax for opening a report

60 Views Asked by At

I am getting a Runtime 2465 error message trying to open a report using the following routine:

DoCmd.OpenReport "rptSprechi", acViewPreview, , [qry_rptsprechi].[WasteType] = "UE", acIcon
1

There are 1 best solutions below

1
On BEST ANSWER

The fourth argument (WhereCondition) is supposed to be a string value. Yours looks wrong to me.

Try it this way ...

DoCmd.OpenReport "rptSprechi", acViewPreview, , "[WasteType] = 'UE'", acIcon