hi:
i want to compare the values that entered into text boxes with fields in table
if it exists in the table i want to open page called (result)
else open(voting)
but when i run the program my code in two cases open the result page
here is my code
i want to compare the values that entered into text boxes with fields in table
if it exists in the table i want to open page called (result)
else open(voting)
but when i run the program my code in two cases open the result page
here is my code
Code:
If Me.f2.Value = DLookup("Passwords", _
"Passwords", _
"[Names]='" & Me.f1.Value & "'") Then
'
DoCmd.Close acForm, "Main form", acSaveNo
DoCmd.OpenForm "result"
ElseIf Me.f2.Value <> DLookup("Passwords", _
"Passwords", _
"[Names]='" & Me.f1.Value & "'") Then
'
DoCmd.Close acForm, "Main form", acSaveNo
DoCmd.OpenForm "Voting"
End If
Comment