Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-time error 2001 when cancelling query with run-time parameters

Status
Not open for further replies.

fogcity

Programmer
Feb 8, 2008
8
US
I have a form which allows users to select a query to be run. Some of these queries have a run-time parameter defined using the default Access 2007 define parameter feature. At run-time the default dialog box titled "Enter Parameter Value" is displayed to the user with OK and Cancel buttons. However if the user clicks on the cancel button an error message is received:

Run-time error '2001':
You canceled the previous operation.
[with buttons for End, Debug, Help]

If the user clicks on 'End' everything is okay, however I would prefer to make this behavior more user friendly. How do I capture the Cancel event and gracefully cancel running the query?

 
Why not simply use error handling in your VBA code ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top