ArtificialSoldier, on 13 May 2014 - 12:20 PM, said:
You could add the department head field to that query to make sure it is set to what you want.
Here is my latest attempt:
If ("[tblUserSecurity_Sec].UserID, [tblUserSecurirt_Sec].pw, [tblUserSecurity_Sec].DeptID, [tblUserSecurity_Sec]" _
& "WHERE [tblUserSecurity_Sec].UserID = '" & txtUserID & "' AND [tblUserSecurity_Sec].pw = '" & txtPW & "'") Then
DoCmd.OpenForm "frmEmployees", acNormal, , "DeptID='" & ("DeptID.Value") & "'"
Call MsgBox("You do NOT have Department Head Clearance," _
& vbCrLf & "Please Contact your System Administrator for Help." _
, vbExclamation, Application.Name)
It does not relate to the actual Login but relates to the frmEmployees ONLY showing Employees assigned to the same DeptID as the Person who LoggedIn.
DptID in tblEmployees (Number)
DeptID in tblUserSecurity_Sec (Yes/No)