If your not worried about case-sensitivity,your using a combo box to list your usernames, and the combo box has the following columns as suggested above:
UserID
Username
DeptID
then you could use something like:
If txtPassword <> DLookup("[Password]", "tblUsers", "[UserID]=" &...