I created a form that helps the user create a new password. I want to create an update query that will take the new password and overwrite it for the appropriate user in the table. Attached is what I have:
Private Sub cmd_changepass_Click()
If IsNull(Me.txt_username) Then
MsgBox " Enter your Username"
Exit Sub
Else
If (Me.txt_newpass <> Me.txt_confirmpass) Then
MsgBox "Passwords do not match"
Exit Sub
Else
End If
If Me.txt_oldPass.Value = DLookup("Password", "[User Table]", "Username = '" & txt_username & "'") Then
MsgBox "YESSS"
Else
MsgBox "Username and password do not match"
Exit Sub
Else
CurrentDb.Execute "UPDATE [User table] set Password = txt_confirmpass WHERE me.txt_username?????? "
End If
End If
End Sub
Thanks for any help
Private Sub cmd_changepass_Click()
If IsNull(Me.txt_username) Then
MsgBox " Enter your Username"
Exit Sub
Else
If (Me.txt_newpass <> Me.txt_confirmpass) Then
MsgBox "Passwords do not match"
Exit Sub
Else
End If
If Me.txt_oldPass.Value = DLookup("Password", "[User Table]", "Username = '" & txt_username & "'") Then
MsgBox "YESSS"
Else
MsgBox "Username and password do not match"
Exit Sub
Else
CurrentDb.Execute "UPDATE [User table] set Password = txt_confirmpass WHERE me.txt_username?????? "
End If
End If
End Sub
Thanks for any help