I have an MS Access form with buttons that when clicked, open up tables and queries through an on-click event --> open form command. The parameter box opens, but when I press cancel a window titled "Macro Single Step" appears saying Error Number: 2001. There's a button called Stop All Macros here.
How can I press cancel without getting an error? I don't use VBA at all when the button is pressed so how can I catch this error and not display it?
Update: I found out that in design view if I click on my embedded macro in the on click event of the button, there's an option for "On Error". There are two parts to fill out: "Go to" and "Macro Name". Go to has the options: Next, Macro, fail. How can I specify a "do nothing" kind of action?
On Error Resume Next
if you want to ignore canceling. – AndreDoCmd.OpenQuery "myQuery"
- a macro can't really be simpler. :) – Andre