This is AIR CODE!!!
Code:
Dim SU as Boolean
'Check the value of the password in tblEmployeeRoster to see if this
'matches the value chosen in combo box
If Me.txtPassword = DLookup("Emp_Pass", "tblEmployeeRoster", "[Emp_ID] = '" & Me.cboIdentity & "'") Then
Emp_ID = Me.cboIdentity.Value
End if
SU = FALSE
SU = DLookup("Super_User", "tblEmployeeRoster", "[Emp_ID] = '" & Me.cboIdentity & "'")
'Close the Log In form and open the Editor window
DoCmd.Close acForm, "frmLogIn"
If SU Then
DoCmd.OpenForm "frmEmployeeData"
Else
DoCmd.OpenForm "frmMainMenu"
End if
---------------
Just curious....
How is the "Emp_ID" entered/selected?
If you were to use a combo box, the password and the super user status could be columns in the combo box. You wouldn't have to use the DLookup() function. Just set the column widths of the two columns to zero. They would still be available but not visible.