Hi all,
I'm not sure what I am doing wrong, but when I run the code below I get a Error 2471, The expression you entered as a query parameter produced this error 'u09515'
Unfortunately, I don't know if that u09515 is from the table I'm pulling from or the unbound textbox txtUser. :/
The ultimate goal is to enter a value into txtPW and txtUser and to use DLookup to check if that is a valid user/password combination and allow them access to the database.
Thanks in advanced!
Code:
If Me.txtPW.Value = DLookup("Password", "tblLogin", "[UserName] = " & Me.txtUser.Value) Then
DoCmd.Close acForm, "frmLogin"
Else
MsgBox "Invalid password/user name combination. Please try again.", vbOKOnly, "Login Error"
Me.txtPW.SetFocus
End If