Skip to content
No results
  • Home
  • Projects
  • Series
    • Accounting Series
  • Downloads
  • Tutorials
    • MS Access Tutorials
  • Blog
    • MS Access Blog
  • Forum

Physical Address

304 North Cardinal St.
Dorchester Center, MA 02124

skillheader Logo
  • Home
  • Projects
  • Series
    • Accounting Series
  • Downloads
  • Tutorials
    • MS Access Tutorials
  • Blog
    • MS Access Blog
  • Forum
skillheader Logo

Part 3 – Change Password System in MS Access

  • Projects

In this section, you will learn the advanced functionality of the Login System and how to make the change password system in MS Access functional with VBA and SQL coding. You can go through the first and the second part of the Ultimate Login System.

Watch the Video

Subscription to Download Project

Overview of Change Password System

Changing the Password is the most important part of any login system in which the user can change the password at any time to secure his account especially when a user assumes for any unauthorized use of his account.

Old Password Verification

The user must enter his old password before getting into the change password system. To ensure this, you can create one of these options:

  1. Verification of the old password from the same Username and Password text boxes section which are used to log in and proceed to change the password
  2. Having 2 separate text boxes to emphasize the user to enter his Username and Password before proceeding to change the password

We will use the first option to ensure the old password is correct in this project.

Password Policy

An important aspect when securing the account is not only establishing user passwords but also creating an effective password policy. Many configurations can be applied to secure the password from which we are going to apply these functions:

  • The old password must be verified with the username
  • User must enter the same password in both text boxes related to New and Verify Password
  • The password entered in both text boxes should be matched
  • Enforce the creation of a password with a minimum of 8 characters

Other Password Policy Configuration Factors

Other password configuration policy factors can also be applied like:

  • The maximum character length of the password
  • Enforce users to enter numbers and characters
  • Enforce users to use upper and lower case combinations with digits and special characters
  • Prevent the user from using any common word as a password like his username

Redirecting to the login form

After successfully changing the password, the login form will reopen and the user will be redirected to it rather than to proceed to log in because the username and password were already verified while changing the password.

Advanced configuration related to Password and Account Management can be applied in several other ways:
Force users to change passwords regularly
Prevent and secure account after a certain number of failed login attempts
Track and prevent password reuse
If users are part of the business, it should affect or lock out the login form based on the status like disabled, inactive, or resigned if a user is an employee.

Steps of Change Password System in MS Access

Firstly, the objects including 2 text boxes, a label, and the change button will be hidden so these can be unhidden only with a Password Change button clicked. It is important to know that this button-click event will verify the existing username and the old password.

Change Password Button on Click Event

Here is the code for the Change button On Click event:

Private Sub btn_changepassword_Click()
'Checking if both text boxes are empty and return a message
If DCount("uusername", "usertable", "uusername = '" & txt_username & "' and upassword = '" & txt_password & "'") = 0 Then
    MsgBox "Please fill both Username & Password with your credentials !", vbExclamation, "| Fill the empty text boxes |"
        Else
            'Proceeding to authenticate the Username and Password
            If DCount("uusername", "usertable", "uusername= '" & txt_username & "' and upassword= '" & txt_password & "'") = 0 Then
                MsgBox "Username or Password is wrong !", vbCritical, "| Wrong Data |"
                    Else
                        'Makind both text boxes disabled while changing password to avoid conflict
                        Me.txt_username.Enabled = False
                        Me.txt_password.Enabled = False
                        
                        'Proceeding to unhide the new password area
                        Me.txt_newusername.Visible = True
                        Me.txt_verifypassword.Visible = True
                        Me.btn_change.Visible = True
                        Me.Lbl_change.Visible = True
        End If
End If
End Sub

Apply Password Mask

Applying a Password Mask to both text boxes is optional.

Password mask in change password

Proceed to the Change Password Button

Here is a Change button Code to proceed to change the password:

Private Sub btn_change_Click()
'check the empty textboxes
If IsNull(Me.txt_newusername) = True Or IsNull(Me.txt_verifypassword) = True Then
    MsgBox "Please fill both fields !", vbExclamation, "| Fill the empty text boxes |"
        Else
            If Me.txt_username <> Me.txt_verifypassword Then
                MsgBox "Password do not match !", vbCritical, "| Password not matched |"
                Me.txt_newusername.SetFocus
                    Else
                        If Len(Me.txt_newusername) < 8 Then
                            MsgBox "More than 8 characters are not allowed !", vbInformation, "| Character Length |"
                            Me.txt_newusername.SetFocus
                                Else
                                    DoCmd.SetWarnings False
                                    On Error GoTo err_h
                                        DoCmd.RunSQL "UPDATE usertable" & _
                                        " SET usertable.upassword = """ & Me.txt_verifypassword & _
                                        """ WHERE usertable.uusername = """ & Me.txt_username & """"
                                        DoCmd.SetWarnings True
                                        MsgBox "The password has been changed successfully ! Please login again.", vbInformation
                                        Me.txt_username = Null
                                        Me.txt_password = Null
                                        Me.txt_username.Enabled = True
                                        Me.txt_password.Enabled = True
                                        Me.txt_username.SetFocus
err_h:
Cancel = True
                End If
        End If
End If
End Sub

<<Part 2 – Setting up User Authentication in Access

Part 4 – Forgot Password System in MS Access>>

Live Search

No results
  • Watch complete Project/Tutorial Videos
  • Source Code
  • Open Source Project Files
  • Free help on Your Projects
Select Project/Tutorial to Subscribe

Blog Posts

Form Control Methods in MS Access | Why Unbound Form Control Offer Better Flexibility

December 27, 2025

How to Add Placeholder on Text box or Combo box in MS Access Forms

August 16, 2024

How to Mask and Unmask Passwords Using VBA in MS Access

June 1, 2024

How to Filter Data Between Two Dates in MS Access

May 21, 2024

How to Search Records using Number Values with Factors in MS Access

May 21, 2024

The future belongs to those who learn more skills and combine them in creative ways.

Robert Greene

Related Posts

Employee Management HR System featured

Ultimate All-in-One Employee Management & HR System

  • July 4, 2025
Master Accounting Featured Image

How to Build Accounting Software in MS Access – Free Guide

  • November 9, 2024
  • 5 Comments
MCQ Exam Featured

Smart Automated MCQ Exam System | Revolutionizing IQ Learning

  • November 3, 2024

About | Contact Us | Support Us

Copyright © 2026 - skillheader

Privacy Policy | Terms of Use | Forum Rules