Change Password

G

Guest

Could you give me some direction in creating a Change Password form, I seem
to be creating a mess... At this time it bombs at rs.Edit.....


Private Sub cmdLogin_Click()
Dim db As Database
Dim rs As Recordset

Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT DISTINCTROW t_Users.RACFID,
t_Users.Password FROM t_Users WHERE (((t_Users.RACFID)=" & """" & Me.cboUser
& """" & "));")

If txtNewPwd = txtNewPwd1 Then
If rs.RecordCount > 0 Then
rs.MoveFirst
rs.Edit
rs!Password = txtNewPwd
rs.UPDATE
MsgBox "Password changed succesfully."
Else
MsgBox "Verification failed. Password not changed."
DoCmd.Close
End If
DoCmd.openform "f_Lookup"
Exit Sub

Else
MsgBox "Verification failed. New Passwords do not match. Please try
again. ", vbCritical, gappname
txtNewPwd1.SetFocus
Exit Sub
End If

End Sub
 
J

jleckrone

Try this instead:

With rs
..edit
!Password = textNewPwd
..update
End With

Sometimes changing rs to an Object and not a Recordset has helped me
too.
 
G

Guest

If you are suggesting the following, I'm even more confused?

rs.MoveFirst
With rs
.Edit
!Password = txtNewPwd
.UPDATE
MsgBox
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top