Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change password

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

I have the Password table. I want to create form for user enter "userID, Old Password, New Password, and Retype Password" to change the password.
Hope somebody help me out.
Possiblely drop some codes to me.

Thanks.
Grace


 
You will have to do this using VBA. You will need to open a recordset to retrieve their old password for verification:

Dim db As Database
Dim rst As Recordset
Dim strOldPwd As String
Dim strNewPwd1 As String
Dim strNewPwd2 As String
Dim strSQL As String
Dim pos As Integer

IF strNewPwd1 = strNewPwd2 THEN
strOldPwd = Me!OldPassword
Set db = CurrentDb
strSQL = "SELECT * FROM MyTable "
strSQL = strSQL & "WHERE MyTable.UserID = "
strSQL = strSQL & Me.UserID
Set rst = db.OpenRecordset strSQL

rst.MoveFirst
rst.Edit
rst.Password = strNewPwd1
rst.Update

ELSE
'DISPLAY Password Mismatch
END IF

You will also need to handle if the user ID is not found.

Hope that is a start. Terry M. Hoey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top