Please need help with below code it returned "Data type mismatch error" and "Data type mismatch criteria expression error"
Many thanks in advance for your help.
This form to verify the users login id ONLY with tblusers information.
Many thanks in advance for your help.
Code:
Option Compare Database
Option Explicit
Private Sub BtnSubmitLoginID_Click()
On Error GoTo errhandlers:
'Check to see if data is entered into the txtLoginID text box.
If IsNull(Me.txtLoginID) Or txtLoginID = "" Then
MsgBox "You must enter a User Name !", vbOKOnly, "Required Data"
Me.txtEmpID.Visible = False
Me.txtPassword.Visible = False
Me.txtPrevillage.Visible = False
Me.txtQuestion1.Visible = False
Me.txtQuestion2.Visible = False
Me.txtQuestion3.Visible = False
Me.txtAnswer1.Visible = False
Me.txtAnswer2.Visible = False
Me.txtAnswer3.Visible = False
Me.BtnCancel.Visible = False
Me.BtnResetPassword.Visible = False
Else
'check to see entered Login ID is listed in tblUsers or not
Me.txtLoginID.Value = DLookup("LoginID", "tblUsers", "userId='" & Me.txtLoginID & "'")
MsgBox "Entered Login details are not matching with registered user, please provide correct login ID !", vbOKonly, "Login Verification"
Me.txtEmpID.Visible = True
Me.txtPassword.Visible = True
Me.txtPrevillage.Visible = True
Exit Sub
End If
exit_errhandlers:
Exit Sub
errhandlers:
MsgBox Err.Description, vbCritical
Err.Clear
End Sub
This form to verify the users login id ONLY with tblusers information.