Hello,
I created a logIn form for my database and I am working on a form that the user can change his password or reset it....
my table is named "tblUsersÈ and it looks like this...
LastName FirstName User Password EmployeeNo
ABBRUZZESE SAMMY abruzess ***** 11529
ABEL JEAN RONALD abeljea ***** 10477
ABRAHAM CKYRCK.B abrahac ***** 15089
Then in my form I have 4 texbox
User
UserName
Password
PasswordConf
What I would like to do is when I click on the CmdChange, the password has to change and update the table, but if ever the user doesn't type in the same password when he types the password confirmation then he should get an error message stating that the password don't match....
Can anyone tell me how to do this...
This is my code
*************
Private Sub CmdChange_Click()
On Error GoTo Err_cmdChange_Click
If Me![Password] = Me![PasswordConf] Then
MsgBox ("IDENTICAL -- Please update")
DoCmd.OpenForm "Ecran_PCP_form"
DoCmd.Close acForm, "frmLogin"
Else
MsgBox ("Mots de passe ne sont pas identique")
Me![PasswordConf] = ""
Me![User].SetFocus
Me![PasswordConf].SetFocus
DoCmd.CancelEvent
End If
Exit_cmdChange_Click:
Exit Sub
Err_cmdChange_Click:
MsgBox Err.description
Resume Exit_cmdChange_Click
End Sub
Everything works fine but I don't know how to UPDATE the table to erase the old password, and update with the new one.
I created a logIn form for my database and I am working on a form that the user can change his password or reset it....
my table is named "tblUsersÈ and it looks like this...
LastName FirstName User Password EmployeeNo
ABBRUZZESE SAMMY abruzess ***** 11529
ABEL JEAN RONALD abeljea ***** 10477
ABRAHAM CKYRCK.B abrahac ***** 15089
Then in my form I have 4 texbox
User
UserName
Password
PasswordConf
What I would like to do is when I click on the CmdChange, the password has to change and update the table, but if ever the user doesn't type in the same password when he types the password confirmation then he should get an error message stating that the password don't match....
Can anyone tell me how to do this...
This is my code
*************
Private Sub CmdChange_Click()
On Error GoTo Err_cmdChange_Click
If Me![Password] = Me![PasswordConf] Then
MsgBox ("IDENTICAL -- Please update")
DoCmd.OpenForm "Ecran_PCP_form"
DoCmd.Close acForm, "frmLogin"
Else
MsgBox ("Mots de passe ne sont pas identique")
Me![PasswordConf] = ""
Me![User].SetFocus
Me![PasswordConf].SetFocus
DoCmd.CancelEvent
End If
Exit_cmdChange_Click:
Exit Sub
Err_cmdChange_Click:
MsgBox Err.description
Resume Exit_cmdChange_Click
End Sub
Everything works fine but I don't know how to UPDATE the table to erase the old password, and update with the new one.
Last edited: