lorenambrose
Active Member
- Joined
- Sep 17, 2008
- Messages
- 265
I have a form that on loading prompts for a password.
How do I modify this code to close or NOT LOAD the form if the user inputs the wrong password. Right now if the password is incorrect the "Authorization Denied" msg box appears and I would like the form to NOT OPEN when they select OK. Hope someone can help.
Private Sub Form_Load()
If InputBox("Enter Password") = "qazz" Then
DoCmd.OpenForm "Edit an ER"
Else
MsgBox "Authorization Denied", vbOKOnly
End If
End Sub
How do I modify this code to close or NOT LOAD the form if the user inputs the wrong password. Right now if the password is incorrect the "Authorization Denied" msg box appears and I would like the form to NOT OPEN when they select OK. Hope someone can help.
Private Sub Form_Load()
If InputBox("Enter Password") = "qazz" Then
DoCmd.OpenForm "Edit an ER"
Else
MsgBox "Authorization Denied", vbOKOnly
End If
End Sub