two ifs

lipin

Registered User.
Local time
Today, 11:27
Joined
May 21, 2002
Messages
149
I have the following code that compares the password the user enters to the one stored in the table for them and it works fine and checks in the textbox SIGNED OFF as it is supposed to.

Private Sub txtpassword_AfterUpdate()
If DLookup("[Employee Number]", "tblEmployee", "[4SSN]= '" & Me![txtpassword] & "'") Then

Forms![frmsignoff]![signoffSUB]![SignOffchk] = 1

Else: MsgBox ("WRONG PASSWORD")
End If

I need to add the following if statement to the above code and am not having much luck integrating the two if statements and having both evaluated. Could someone enlighten me as to how to do this?.

If ([4SSN] = "overide") Then
Forms![frmsignoff]![signoffSUB]![SignOffchk] = 1


THANKS!!!!
 
Your second statement is not doing the DoLookup, which I assume it should. Try-

passw = DLookup("[Employee Number]", "tblEmployee", "[4SSN]")

If passw = Me![txtpassword] OR passw = "override" Then

Forms![frmsignoff]![signoffSUB]![SignOffchk] = 1

Else: MsgBox ("WRONG PASSWORD")
End If
 

Users who are viewing this thread

Back
Top Bottom