Results 1 to 5 of 5
  1. #1
    Ekhart is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jun 2016
    Posts
    80

    User change Password

    I don't know why this has been kicking my butt for so long, but I just cannot figure out how to get Password changes to work on a user level.

    I have a form with 2 txt boxes to enter a new password and confirm it, these are named txt NewPassword and ConfirmPassword. I have code attached to the After Update field:

    Code:
    Private Sub ConfirmPassword_AfterUpdate()
        If Me.NewPassword = Me.ConfirmPassword Then
            MsgBox "Password updated!", vbOKOnly
            DoCmd.Close acForm, "frmPasswordChange"
        Else
        MsgBox "Passwords don't match please re-enter!", vbOKOnly
        Me.NewPassword.SetFocus
    End If
    End Sub
    I cannot figure out, and I have tried many different things, how to get it to take the password they enter and put that in the tblEmployeeFiles table to update it. They reference their own record by Forms!frmLogin!cboUser.Column(0) which is linked to the EmployeeID on the tblEmployeeFiles table. The password field is UserPassword.

    I have kind of put this on a backburner as it is only marginally important at the moment, but it has been driving me crazy I can't figure out what to put in

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    There is nothing in this AfterUpdate event code to store the new Password if that helps.

  3. #3
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    You could put a SQL update after the confirmation msgbox, something like this:

    CurrentDb.Execute "Update tblEmployeeFiles set UserPassword = '" & me!confirmPassword & "' Where EmployeeID = " & Forms!frmLogin!cboUser.Column(0), dbFailonerror

  4. #4
    Ekhart is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jun 2016
    Posts
    80
    Quote Originally Posted by John_G View Post
    You could put a SQL update after the confirmation msgbox, something like this:

    CurrentDb.Execute "Update tblEmployeeFiles set UserPassword = '" & me!confirmPassword & "' Where EmployeeID = " & Forms!frmLogin!cboUser.Column(0), dbFailonerror
    Worked like a charm, thanks! Guess I need to brush up on my SQL

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Great news. I used the Thread Tools at the top of this thread to mark this thread as Solved.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 12-16-2015, 02:41 PM
  2. Password Change Issue
    By dascoli in forum Programming
    Replies: 3
    Last Post: 05-28-2013, 02:20 PM
  3. Replies: 1
    Last Post: 06-22-2012, 08:05 AM
  4. Change Password Form using VBA
    By anwaar in forum Programming
    Replies: 2
    Last Post: 09-02-2011, 01:29 PM
  5. Change from old password to new password
    By richy in forum Security
    Replies: 0
    Last Post: 11-17-2005, 05:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums