Link to home
Start Free TrialLog in
Avatar of Sheils
SheilsFlag for Australia

asked on

Stop debug when a docmd operation is cancelled

I am using the following code to open a form

Private Sub License_Certificate_Click()
DoCmd.OpenForm ("edit records")

End Sub

The record source for the form is a query which asks for the license number before opening. Everything works fine except for when you forget the license number and click cancel on the message box. This gives an error and opens the dedugging dialog box.

How do I stop the code from activating dedug when someone press cancel on the message box  
ASKER CERTIFIED SOLUTION
Avatar of Leigh Purvis
Leigh Purvis
Flag of United Kingdom of Great Britain and Northern Ireland 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 Sheils

ASKER

Thanks LPurvis