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
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