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 2 – Setting up User Authentication in Access

  • May 18, 2024
  • Projects

After designing the Ultimate Login Form, you need to create a user table for setting up user authentication to function. To get the functionality of the login form, you have to create a second form like the main dashboard which contains a logout functionality so the user can redirect to the login form after logging off.

Watch the Video

How to Download Project

Steps to Setting Up User Authentication

1. Create a User Table

Create a User table with these fields:

Field NameData TypeDescription
uidAutoNumberUser ID
unameShort TextName
udateDate/TimeUser Date
ugenderShort TextUser Gender
uageNumberUser Age
uusernameShort TextUser Name
upasswordShort TextPassword
ustatusShort TextUser Status
User Table
  • First of all, create a table in the design view from “Create Menu”
  • Use data type “Lookup Wizard” for the drop-down menu of Field Name “Gender”
  • The first ID field must contain a Primary Key for a unique identifier

Fill data with some demo records.

User Table

2. Dashboard Form with Logout

Create a Main Dashboard demo form with a Logout button. The user will be redirected to the Login Form after successful logoff.

Hence, the Main Dashboard form will be the first appearance for the user after login, you can create a Multi-User with separate dashboard forms. For example, the Admin Dashboard will be open for Admin accounts and the User Dashboard will be open for Users. Later on, you can create User-level authentications as well. Refer to the Expense Management Project to assign a Multi-User System.

3. Login Button Functionality

Before Login Button On click event code, you need to make a label for “Incorrect Username or Password” and hide it from the Format properties.

Login Button On Click event Code

Private Sub btn_login_Click()
If DCount("uusername", "usertable", "uusername = '" & txt_username & "' and upassword = '" & txt_password & "'") = 0 Then
    Me.Lbl_incorrect.Visible = True
        Else
            DoCmd.Close acForm, "LoginForm"
            DoCmd.OpenForm "MainForm"
End If
End Sub

The login button must be working fine to open the Dashboard Form if the Username and Password are correct. Please make sure that the name of the form is “MainForm”.

4. Logout Button Functionality

Logout Button Code to close the Main Form and open the Login Form:

Private Sub btn_logout_Click()
responce = MsgBox("Do you really want to logout?", vbYesNo + vbQuestion, "| Logout Confirmation |")
    If response = vbYes Then
        DoCmd.Close acForm, "MainForm", acSaveNo
        DoCmd.OpenForm "LoginForm"
            Else
                Cancel = True
End If
End Sub

<<Part 1 – Designing Ultimate Login Form in Access

Part 3 – Change 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

Placeholder on Text box or Combo box in MS Access Forms

August 16, 2024

Uncover Password Mask Unmask VBA Strategies 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

How to Find Record using Combo Box List Selection or Type

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 © 2025 - skillheader

Privacy Policy | Terms of Use | Forum Rules