Password protect a button

Chimp8471

Registered User.
Local time
Today, 20:28
Joined
Mar 18, 2003
Messages
353
Can someone point me in the right direction of how to protect a button using a password please

cheers

Andy
 
Not sure if this will work but.
Try creating a form that all it does is ask for a password and then takes you back to the other form. Then when they click the button it pops up and checks to see if the password is valid.

Public strPassword As String

'Click Event of button where you want to check the password
DoCmd.OpenForm "frmPassword"

If Len(strPassword) > 0 Then
If strPassword = "acctucaly password" Then
'Run what ever code you want here
Else
MsgBox "Password not correct"
End If
Else
MsgBox "Pleae Enter a Password"
End If



'Click Event of Close Button on form Password
strPassword = txtPassword.Value
DoCmd.Close

Hope that gets you started in the right direction
 

Users who are viewing this thread

Back
Top Bottom