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
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