1.

Solve : MS Access Password on a form?

Answer»

I would like to CREATE a password on a form, but I cannot GET the form
to close when the wrong password is entered. I have also tried
docmd.close.
Appreciate some help.

Private Sub Form_Current()
Dim Password, Pword
Password = "Swordfish"
Pword = InputBox("Type in your password")
If Pword <> Password Then
MsgBox "Sorry, INCORRECT password"
exit
End If

End Sub
You really need to put the password routine on the procedure that opens the form. Ask for the password before you OPEN the form, not after.

GaryThank you for your help.
Regards



Discussion

No Comment Found