Link to home
Start Free TrialLog in
Avatar of Gary Samuels
Gary SamuelsFlag for United States of America

asked on

Catch error on open report

DoCmd.openReport "ThisWeekPayReport", acViewReport, , , acDialog

The above command is fired by a button on a form. The data source of the report has a criteria of employee number. Once the button is clicked Access opens a dialog box titled "Enter Parameter Value".  If an incorrect number is entered how can I catch it?

Is there some kind of an OnError condition that I could place the DoCmd inside of that would catch it if an incorrect number was entered?



ASKER CERTIFIED SOLUTION
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gary Samuels

ASKER

I was afraid of that.

Thanks
If I wanted to use a textbox and verified the input.
Could I add the Filter and Where parameters to the DoCmd.openReport statement to accomplish the same thing?

Something like:
DoCmd.openReport "ThisWeekPayReport", acViewReport,Filter=[EmployeeNumber] ,WHERE=textbox.value , acDialog