How would I create a password program for a form in Access?
Basically, when someone clicks on a button, I want the password prog to run, then when they've been authenticated it goes to the form.
Thanks.
Printable View
How would I create a password program for a form in Access?
Basically, when someone clicks on a button, I want the password prog to run, then when they've been authenticated it goes to the form.
Thanks.
What password prog? If the database is password protected, you will be asked to provide it when you atempt to open the database. Same goes for useid's and passwords if you've assigned a password to admin.
You misunderstood...I want the password thing to be internal...ie: you click on a button in the form, the password thing comes up asking for the password to access the next form.
What you'll want to do is create a table that has form name and password in it, then create a form that reads that table and hides the password value (as well as providing a text field for the user to enter a password in). You then compare the hidden field with the text field before proceeding...
Try this...
Private Sub Command1_Click()
On Error Goto Err_OpenForm
Dim Mypwd As String
Mypwd=Inputbox("Enter Your Password")
If Mypwd<> "YourPassword" Then
Exit Sub
Else
Docmd.OpenForm, "FormName"
Endif
Exit_OpenForm:
Exit Sub
Err_OpenForm:
Msgbox Err.Number & " ; " & Err.Description
Resume Exit_OpenForm
End Sub
If you encrypt the password before placing it into the DB with a one-way method such as MD5, then to check it, encrypt the password they gave, and check the two encrypted versions. Since it is very difficult to get at the password from the encrypted version, it is much more secure.