Change Password Form...not working

lipin

Registered User.
Local time
Today, 08:32
Joined
May 21, 2002
Messages
149
I have a form that opens from a command button that lets users change their passwords(hopefully).
There are 3 textboxes: Clock #, new password, confirm new password

I can get the check to confirm the password to work but I can't get where the password field updates with the new password.

Here is the code on a command button:
Private Sub cmdChangePW_Click()
On Error GoTo Err_cmdChangePW_click

If Me![txtNewPassword] = Me![txtConfirm] Then

Dim db As Database
Dim rs As Recordset

Set db = CurrentDb
Set rs = db.OpenRecordset("tblpassword", dbOpenDynaset)


With rs

If .Fields("Clock Number") = Me![txtClockNum] Then
.Edit
.Fields("password") = Me![txtNewPassword]
.Update

End If

End With

Set rs = Nothing
Set db = Nothing
DoCmd.Close

Else
MsgBox ("Password doesn't match Confirmation")
Me![txtNewPassword] = ""
Me![txtConfirm] = ""
Me![txtNewPassword].SetFocus

End If

Exit_cmdChangePW_Click:
Exit Sub

Err_cmdChangePW_click:
MsgBox Err.Description
Resume Exit_cmdChangePW_Click
End Sub

Is there an easier way? What needs changed?
 

Users who are viewing this thread

Back
Top Bottom