Simple Password Form

Treisio

Registered User.
Local time
Today, 03:41
Joined
May 21, 2013
Messages
12
Hello everyone. I'm a new user of Access and am having some issues with a password form. I created a button that launches a form with a textbox field and a button. I want it to launch another form if the password is entered correctly. Here's my code...

Code:
Private Sub btnPassword_Click()

If TxtPassword.Text = "admin" Then
DoCmd.OpenForm "Management"
End If

End Sub
At the moment, I can't figure out how to make this work. This database doesn't contain anything confidential, so higher security measures aren't necessary. I just want a basic log-in form to keep certain users from messing around with some options I have set up.

Thanks in advance!

Edit: Spelling
 
Just took out .Text and it works. I guess VBA isn't that similar to VB.
 
Alternatively, try

strPassword = inputbox("Enter Your Password")
if strPassword = "admin" then docmd.openform "myForm"
 

Users who are viewing this thread

Back
Top Bottom