If the default password is entered, another forms pops up asking the user to change their password (this is where my problem comes in):
The first textbox on the Change Password form asks the user to enter a new password and the second textbox asks the user to enter the password in again to confirm it. If the information entered in both textboxes are equal, I would like to use a RunSql to update the table that holds the password information The code I am using is as follows:
Expand|Select|Wrap|Line Numbers
- Private Sub cmdSubmit_Click()
- Dim strSQL As String
- If txtNewPswd <> txtConfirmPswd Then
- MsgBox "Passwords don't match. Please try again.", vbOKOnly
- Else
- If txtNewPswd = txtConfirmPswd Then
- strSQL = " UPDATE tblUserDefinitions"
- strSQL = strSQL & " SET Password = ' " & Me.txtConfirmPswd
- strSQL = strSQL & " 'WHERE lngEmpID = '" & Me.txtlngEmpID & "';"
- DoCmd.RunSQL strSQL
- MsgBox "Password change successful!", vbOKOnly
- DoCmd.OpenForm "frmLogon"
- DoCmd.Close acForm, "frmPWChng", acSaveNo
- End If
- End If
- End Sub