G
Guest
I've entered the following code to the click event of a button to open a form
if the [EmpID] and [EmpName] selected from a list box and stored in Text24
and Text34 on the current form match the corresponding password in the table
to the one entered on the current form. [EmpID] is a number & [EmpName] is
Text. It works with one or the other in the code, but not with both. Can
anyone see what I'm doing wrong?
=================================================
If Me.txtPassword.Value = DLookup("EmpPassword", "tblEmployees", "[EmpID]="
& Me.Text24.Value And "[EmpName]='" & Me.Text34.Value & "'") Then
lngMyEmpID = Me.Text24.Value
DoCmd.Close acForm, "frmLogon", acSaveNo
DoCmd.OpenForm "frmShop"
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
Me.txtPassword.SetFocus
End If
if the [EmpID] and [EmpName] selected from a list box and stored in Text24
and Text34 on the current form match the corresponding password in the table
to the one entered on the current form. [EmpID] is a number & [EmpName] is
Text. It works with one or the other in the code, but not with both. Can
anyone see what I'm doing wrong?
=================================================
If Me.txtPassword.Value = DLookup("EmpPassword", "tblEmployees", "[EmpID]="
& Me.Text24.Value And "[EmpName]='" & Me.Text34.Value & "'") Then
lngMyEmpID = Me.Text24.Value
DoCmd.Close acForm, "frmLogon", acSaveNo
DoCmd.OpenForm "frmShop"
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
Me.txtPassword.SetFocus
End If