I have some code that runs on a Form_Open event. The code opens a password form then continues with the form_open if it matches. If it does not match it cancels the form_open.
When the form_open is cancelled I get a message from Access, "OpenForm action was cancelled". I'd prefer not to see this message. Is there a way to suppress this?
I've already tried docmd.setwarnings false. Doesn't help.
Here is the code:
If Not (rs![KeyCode] = MyPassword) Then
MsgBox "Sorry you entered the wrong password." & _
"Try again.", vbOKOnly, "Incorrect Password"
Cancel = True
End If