Hi guys, please help, what is wrong with this statement below which i am using on a login form?: below is part of the OnClick Event on the OK button on the login box form. The statement is supposed to check the value of the password in "tblEmployees" to see if this matches the value chosen in combo box:
--------------------------------------------------
If Me.txtPassword.Value = DLookup("strEmpPassword", "tblEmployees", "[strEmpName]=" & Me.cboEmployee.Value) Then
strMyEmpName = Me.cboEmployee.Value
-------------------------------------------------
I keep getting an error (as seen in attachment)
The statement used to look like the one below until i deleted the IntEmpID field from tblEmplyees. IntEmpID (numerical data) used to be the primary key but i changed it to the field "strEmpName" (Employee Username) instead (see original statement below):
----------------------------------------------------
If Me.txtPassword.Value = DLookup("strEmpPassword", "tblEmployees", "[lngEmpID]=" & Me.cboEmployee.Value) Then
lngMyEmpID = Me.cboEmployee.Value
--------------------------------------------------
If Me.txtPassword.Value = DLookup("strEmpPassword", "tblEmployees", "[strEmpName]=" & Me.cboEmployee.Value) Then
strMyEmpName = Me.cboEmployee.Value
-------------------------------------------------
I keep getting an error (as seen in attachment)
The statement used to look like the one below until i deleted the IntEmpID field from tblEmplyees. IntEmpID (numerical data) used to be the primary key but i changed it to the field "strEmpName" (Employee Username) instead (see original statement below):
----------------------------------------------------
If Me.txtPassword.Value = DLookup("strEmpPassword", "tblEmployees", "[lngEmpID]=" & Me.cboEmployee.Value) Then
lngMyEmpID = Me.cboEmployee.Value