Getting passwords from forms

jezh

New member
Local time
Today, 21:38
Joined
Feb 22, 2006
Messages
6
hey, i have been designing a database and i have made a switchboard with forms on it and i have another switch board with backoffice functions which i only want staff with admin rights to be able to get into. i am using the code below but what i need to figure out is how to select any Password from the "Password" field where users have "Admin" in their "Access Rights" column. if that makes sense to any of you!

heres the code

Private Sub cmdOpenEmpForm_Click()

'Attached to On Click event of cmdOpenEmpForm

Dim strPasswd

strPasswd = InputBox("Enter Password", "Restricted Form")

'Check to see if there is any entry made to input box, or if
'cancel button is pressed. If no entry made then exit sub.

If strPasswd = "" Or strPasswd = Empty Then
MsgBox "No Input Provided", vbInformation, "Required Data"
Exit Sub
End If

'If correct password is entered open Employees form
'If incorrect password entered give message and exit sub

If strPasswd = "Graham" Then
DoCmd.OpenForm "frmEmp", acNormal
Else
MsgBox "Sorry, you do not have access to this form", vbOKOnly, "Important Information"
Exit Sub
End If
End Sub


at the moment the password is just set to Graham, any help would be fantastic
 
passwords

Graham,

find attached a popup password form. I have used this as a basis for entering a database and for allowing access to protected forms.

you will need to create a table containing user ID and password details. The advantage of this method is that its easy to add additional users and remove others. It also allows each user to have their own individual password.

You will probably need to modify it a bit to get it to how you want it. Hopefully it will be enough to get you started.

regards

Ian
 

Attachments

Users who are viewing this thread

Back
Top Bottom