Super Close...I think. This is what I have so far for the Change password form....
Code:
Private Sub ConfirmNewPassword_AfterUpdate()
'moves the focus so I can clear the text boxes later
DoCmd.GoToControl "CurrentPassword"
If Me!ConfirmNewPassword = Me!NewPassword Then
'update to the new password and tell user
HELP PLEASE I cant figure out what to put here to get the "PW" field
to change in the table to what the "NewPassword" is being desired on this form. HELP PLEASE
MsgBox "Password has been changed"
Else
MsgBox "Failed. Passwords have NOT been changed"
End If
'clear the text boxes and disable
Me!NewPassword = ""
Me!ConfirmNewPassword = ""
Me!CurrentPassword = ""
Me!NewPassword.Enabled = False
Me!ConfirmNewPassword.Enabled = False
End Sub
This is what I have on the after update for the CurrentPassword textbox...
Code:
Private Sub CurrentPassword_AfterUpdate()
'if the user knows the existing password, allow him to change it
If Me.CurrentPassword.Value = DLookup("PW", "Utility") Then
Me!NewPassword.Enabled = True
Me!ConfirmNewPassword.Enabled = True
Else
Me!NewPassword.Enabled = False
Me!ConfirmNewPassword.Enabled = False
MsgBox "Password is incorrect"
End If
End Sub
Also Just for note, I have created a practice DB to try to figure this out. Table and form names are different from the original post.
Table is now: Utility---Done
Form1: EnterPW---Done
Form2: Acuren---Simply the form I am trying to get access to after a password is entered---Done
Form3: ChangePW---still working on code to allow form to change the data in the table.---NOT Done