Results 1 to 9 of 9
  1. #1
    funkygoorilla is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    93

    Change password form

    Hi,
    Does anyone have some quick VBA to use for a password change form? I have a form that asks for the users New Password, and an Old Password, but I need to be able to check and see if they entered the New Password in correctly. I figure you could do that by have the password fields check against eachother but I have yet to figure that out. Any help would be greatly appreciated.
    FunkyG

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    If it's a new password, what would it be checked against? Could they not enter whatever they want the new password to be?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    funkygoorilla is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    93
    Not really checked against anything, but checked against itself. Its a common practice when resetting a password. You type in your old one, then type in your new one twice. Then if the passwords don't match, then the program will tell you. If they do match, then the password resets. I need the VBA to compare the two new passwords to make sure they match.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    You have two textboxes to enter the new password? In the AfterUpdate event of textbox2 (or a button Click event):

    If Me.textbox1 = Me.textbox2 Then
    'do this
    Else
    'do this
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    funkygoorilla is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    93
    Hi June, you are probably the most helpful on this forum. Here is the code I came up with. I have a Save button that I need to save the entered password, and compare it between the two. But, the button doesnt respond.
    Code:
    Private Sub btnSave_Click()
    If Me.pwFirst = Me.pwSecond Then
    DoCmd.RunCommand acCmdSaveRecord
    Exit Sub
    Else
    If Me.pwFirst <> Me.pwSecond Then
    MsgBox "New Passwords do not match. Re-enter ." _
            & vbCrLf & "and please try again.", vbCritical, _
            "Re-enter both Passwords."
    Exit Sub
    End If
    DoCmd.CloseForm "frmChangePasswordtest"
    DoCmd.OpenForm "frmMainMenu"
    End Sub

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Does the Event property of the button Click show [Event Procedure]? Both If conditions have Exit Sub so the CloseForm and OpenForm methods never run. Probably should also check that one of the boxes is not empty.
    Code:
    Private Sub btnSave_Click()
    If Me.pwFirst = Me.pwSecond And Len(Me.pwFirst) & "" > 0 Then
        DoCmd.RunCommand acCmdSaveRecord
        DoCmd.CloseForm "frmChangePasswordtest"
        DoCmd.OpenForm "frmMainMenu"
    Else
        MsgBox "New Password entries do not match. Re-enter ." _
            & vbCrLf & "and please try again.", vbCritical, _
            "Re-enter both Passwords."
    End If
    End Sub
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    funkygoorilla is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    93
    Hi, Ok, I got the code to work now. But, when I enter a password in each field, it will take if one is using capitals and the other is not. Is this a true comparison? Also, is there code that will save one of the entries from one of the entry fields to the table? Hopefully this makes sense.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Access and VBA are not case sensitive when matching data. Forcing case sensitivity in data comparison is not something I have dealt with. I suggest this is a non-issue and ignore it or Google the topic and see if you can find someone has dealt with this.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    funkygoorilla is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    93
    OK thanks again for all your help. I will continue Googling, and also post the question in the VBA forums. FunkyG

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

Similar Threads

  1. Change Password form
    By turbo910 in forum Forms
    Replies: 16
    Last Post: 05-07-2015, 09:02 AM
  2. Change Password Form using VBA
    By anwaar in forum Programming
    Replies: 2
    Last Post: 09-02-2011, 01:29 PM
  3. Change username and password form..
    By Mrcams in forum Access
    Replies: 9
    Last Post: 12-07-2010, 11:22 AM
  4. Password change issues
    By westeral in forum Access
    Replies: 0
    Last Post: 11-28-2009, 09:20 AM
  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