Originally posted by NeoPa
Hello NeoPa,
I am having the same probelm, but cannot get the code to verify the user's old password in order to enter a new password. If you could look over it, that would be great. Thanks.
Code:
Private Sub txtPassword_AfterUpdate()
Dim pswd As String
Dim confirm As String
pswd = DLookup("[strEmpPassword]", "tblUsers", "[IngEmpID]=" & txUser)
If pswd = "password" Then
EnterPassword:
pswd = InputBox("Please enter a new password", "Change Password")
confirm = InputBox("Please new password again.", "Password Confirmation")
If pswd <> confirm Then
MsgBox "Passwords do not match.", vbOKOnly
GoTo EnterPassword
Else
DoCmd.RunSQL "UPDATE tblUsers SET [strEmpPassword]]= '" & Me.pswd & "' WHERE [txtUser]='" & Me.txtUser & "';"
End If
Else
'Your normal password checking code here
End If
End Sub
Comment