cancel and exit form

gebuh

Registered User.
Local time
Today, 15:53
Joined
Jun 16, 2006
Messages
21
Hi all, I have a textbox with an input mask for an id number, so if I begin adding numbers I get an error message if they're not in correct format- this is fine- but I want the user to be able to cancel the entry and exit the form, but when I click the cancel button I get an error message about the id format- anyone know how I can allow cancel to override this?
thanx
 
The simplest way is to instruct the user to hit the escape button and then close the form...
 
Determine what the Access error number is and then capture it in an ErrHandler, like so:

ErrHandler:
If Err.Number Then
If Err.Number = ???? Then 'user clicked CANCEL
Resume Next
End If
End If
 

Users who are viewing this thread

Back
Top Bottom