Password protecting forms?

Durien512

Registered User.
Local time
Today, 00:39
Joined
Dec 14, 2005
Messages
61
how can i password protect a form?

i want a have a button that on click will ask for the password. if the password is correct then proceed to open the for else tell them they are not authorized.

i know i would need an if statement but thats as far as i got..
can some one provide me with some sample code?

thanks
 
i found this searching but i am not sure if thats what i am looking for..

Private Sub Form_Click()
Private Sub Form_Open(Cancel As Integer)
Dim x As String
x = "password"
Dim y As String
y = InputBox("Enter Password for form")
If x <> y Then
MsgBox ("Invalid password")
DoCmd.CancelEvent

End If
End Sub
 
Yeah that should work for you. the current password is Password.
 

Users who are viewing this thread

Back
Top Bottom