Link to home
Start Free TrialLog in
Avatar of NNiicckk
NNiicckk

asked on

Creating a Change Password form on Access 2010

I  created a table and query with the following fields (qryUser):

UserID
FName
LName
Employee Name
Password


I have a frmLogin to select Employee and enter the password:

Private Sub Command12_Click()

'Check for correct password
If Me.txtPassword = Me.cboUser.Column(2) Then
    DoCmd.Close acForm, "frmLogin", acSaveNo
    DoCmd.OpenForm "Home"
Else
    MsgBox "Password does not match, please re-enter!", vboOkOnly + vbExclamation
    Me.txtPassword = Null
    Me.txtPassword.SetFocus
End If
End Sub


I created a form for changing the password - button on frmLogin opens frmPasswordReset

Select Employee box and text boxes to enter current password and new password twice.  

Private Sub btnSave_Click()
If Me.pwFirst = Me.pwSecond And Len(Me.pwFirst) & "" > 0 Then
    DoCmd.CloseForm "frmPasswordReset"
    DoCmd.OpenForm "Home"
Else
    MsgBox "New Password entries do not match. Re-enter ." _
        & vbCrLf & "and please try again.", vbCritical, _
        "Re-enter both Passwords."
End If
End Sub



I have most of it, but I am trying to bind employee name selected on frmlogin to employee name/old password on the frmPasswordReset form then get it to change the password on qryUser.  Can you help?
Example.accdb
SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NNiicckk
NNiicckk

ASKER

Great help!