View Single Post
  #3  
Old May 29th, 2010, 01:09 AM posted to microsoft.public.access.forms
blanch2009
external usenet poster
 
Posts: 11
Default password-protected form

How do you clear or reset the password?

"Sam Kuo" wrote:

Katherine wrote:
Is it possible to password protect a form rather than the
entire Database?


Gerald Stanley replied:
Something along the lines of

Private Sub Form_Open(Cancel As Integer)
Const strFormPassword As String = "Password"


If InputBox("Please Enter Password") strFormPassword Then
MsgBox "Password Incorrect", vbOKOnly
Cancel = True
End If


End Sub


I have a commond button on form1 that opens the password-protected form2. If incorrect password is entered, the code above shuts form1 which was opened originally. Can this code be altered in such way that form1 remains open if incorrect password is entered, and possibly with a pop-up message asking to try again?

Sorry that I am not code literate at all. Thanks for any help!
Sam