G
Guest
I need to put a password on a button in a form. Here is what I have done. On
the form, I have the button open another form I called password. On the
password form, I have put in a text field I called password. On the
properties of the text field that is called password I went to the data tab
and set the input mask to "Password". On the Event tab, in the "After Update"
field, I clicked on the "..." to go into the code builder. I put the below
code in and it does not seem to care if I put anything in there. It just will
NOT open up the form called "Admin Form". I know I must be missing something
somewhere. From what I read, this should work. Also, could you give me a hint
as to where or how to easily change the password without having to go into
the code builder(I.E.- a button that says "change password here" sort of
thing)? Thank you in advance. BTW I am using Access 2003 if that means
anything special.
Private Sub Text2_AfterUpdate()
Dim strpwd As String
Const conGoodPwd As String = "studio"
Dim intMaxTries As Integer
For intMaxTries = 1 To 3
If strpwd = conGoodPwd Then 'Good
DoCmd.OpenForm "Admin Form", acNormal
DoCmd.Close
Exit For
End If
Next intMaxTries
End Sub
the form, I have the button open another form I called password. On the
password form, I have put in a text field I called password. On the
properties of the text field that is called password I went to the data tab
and set the input mask to "Password". On the Event tab, in the "After Update"
field, I clicked on the "..." to go into the code builder. I put the below
code in and it does not seem to care if I put anything in there. It just will
NOT open up the form called "Admin Form". I know I must be missing something
somewhere. From what I read, this should work. Also, could you give me a hint
as to where or how to easily change the password without having to go into
the code builder(I.E.- a button that says "change password here" sort of
thing)? Thank you in advance. BTW I am using Access 2003 if that means
anything special.
Private Sub Text2_AfterUpdate()
Dim strpwd As String
Const conGoodPwd As String = "studio"
Dim intMaxTries As Integer
For intMaxTries = 1 To 3
If strpwd = conGoodPwd Then 'Good
DoCmd.OpenForm "Admin Form", acNormal
DoCmd.Close
Exit For
End If
Next intMaxTries
End Sub