hi, in addition to having a combo box and txtPassword, I have modified my login form to include two more text boxes (txtnewPW and txtConfPW). These are initially invisible but when the user's PWreset field (in the user table) is true, they become visible. When I click on the OK button, I want the new password to update user's password in the table tblUser.
on the highlighted line, I'm getting run-time error 3464: "data type mismatch in criteria expression". what is wrong with this code?
Dim strSQL As String
Dim db As DAO.Database
Set db = CurrentDb
strSQL = "UPDATE tblUser SET tblUser.strPassword = '" & Me.txtConfPW.Value & "' " & "WHERE (((tblUser.UserID)='" & Forms!frmLogin!cmbUser.Column(0) & "'));"
If Not IsNull(Me.txtPassword) And Me.txtConfPW <> Me.txtPassword Thendb.Execute strSQL, dbFailOnError
DLookup("strPassword", "tblUser", "[UserID]=" & Forms!frmLogin!cmbUser.Column(0)) = Me.txtConfPW.value
MsgBox "Password updated!", vbOKOnly, "Success!"
'MsgBox "You must log in again with new password"
ElseMsgBox "Password confirmation does not match New Password.", vbOKOnly, "Mismatched Password Confirmation"
Me.txtNewPW.Visible = True
Me.txtConfPW.Visible = True
Me.txtConfPW.SetFocus
End If