• Excel and VBA
    • VBA Course
    • Shortcut Keys
    • Useful Formulas
    • Basic Charts
    • Advanced Chart
    • Sort and Filter
    • Pivot Table
    • Data Validation
    • Conditional Formatting
    • Auto Fill and Flash Fill
    • Find and Replace
  • DownloadsPopular
    • Excel VBA Tools
    • Dashboard
      • Excel Dashboard
      • KPI Dashboard
      • Power BI Dashboard
    • Charts
      • Progress Charts
      • Info-graphics
      • Animated Charts
      • Comparisons
      • Gantt Charts
      • Heatmaps
      • Speedometers
      • Timelines
    • Inventory Management
    • HR and Payrolls
    • VBA Automation
    • Utilities and Converters
    • Checklist
    • Calendars
    • Data Analysis
    • Excel Templates
    • Financial Tools
    • Project Management
    • Sales and Marketing
    • Productivity
  • Excel Dashboard
  • Templates
  • Tutorials
    • Charts and Visualization
    • VBA
    • Excel Tips and Tricks
  • Power BI
  • Template StoreNew
  • CoursesNew
  • About Us
  • Contact Us

PK: An Excel Expert

Transforming Data into Decisions

Home>Blogs>VBA>Login Form for Excel VBA based Application
VBA Login Form
VBA

Login Form for Excel VBA based Application

12 Jun 2019
30737Comments Off on Login Form for Excel VBA based Application

Login Form is very important for any application. We have designed this Login form in VBA User form and connected with MS Access Database. We have used ADODB Connection to connect with MS Access Database. To create the design of this Login form we have taken the support of Microsoft Power Point also.

Table of Contents

Toggle
    • Click here to learn more about ADODB Connection.
    • Below is the code of User login procedure which can be called on Login Button-
  • Login Form for Excel VBA based Application
    • Watch the step by step video tutorial: Login Form for Excel VBA based Application

Click here to learn more about ADODB Connection.

Below is the snapshot of MS Access database table –

MS Access Table
MS Access Table

Click to buy Login Form for Excel VBA based Application

To use the ADODB connection you need add Microsoft ActiveX Data Objects reference.

  • Go to the Visual basic Editor (Press Alt+F11)
  • Go to Tools >> References>> Microsoft ActiveX Data Objects 2.8 Library
Add Reference
Add Reference

Click to buy Login Form for Excel VBA based Application

Below is the code of User login procedure which can be called on Login Button-

Option Explicit

Sub User_Login(User_Id As String, Password As String)

Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset

Dim qry As String

cnn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & ThisWorkbook.Path & "\Database\Database.accdb"

qry = "SELECT * FROM TBL_UM WHERE User_id = '" & User_Id & "'"
rst.Open qry, cnn, adOpenKeyset, adLockOptimistic

If rst.RecordCount = 0 Then
MsgBox "Incorrect User Id", vbCritical
ElseIf rst.Fields("Password").Value = Password Then
MsgBox "Login successfully", vbInformation
Else
MsgBox "Incorrect password", vbCritical
End If

rst.Close
cnn.Close

End Sub

Login Form for Excel VBA based Application

Below is the snapshot of Login form-

Login Form for Excel VBA based Application
Login Form for Excel VBA based Application

Click to buy Login Form for Excel VBA based Application

Visit our YouTube channel to learn step-by-step video tutorials

Youtube.com/@PKAnExcelExpert

Watch the step by step video tutorial: Login Form for Excel VBA based Application

Click to buy Login Form for Excel VBA based Application

Tagged ADODB, Data Entry, Data Entry form in VBA, Login form, MS Access, Power Point, User Form
PK
Meet PK, the founder of PK-AnExcelExpert.com! With over 15 years of experience in Data Visualization, Excel Automation, and dashboard creation. PK is a Microsoft Certified Professional who has a passion for all things in Excel. PK loves to explore new and innovative ways to use Excel and is always eager to share his knowledge with others. With an eye for detail and a commitment to excellence, PK has become a go-to expert in the world of Excel. Whether you're looking to create stunning visualizations or streamline your workflow with automation, PK has the skills and expertise to help you succeed. Join the many satisfied clients who have benefited from PK's services and see how he can take your Excel skills to the next level!
https://www.pk-anexcelexpert.com

Related Articles

Templates VBA

Training Completion Certification Tracker in Excel

July 31, 2025July 31, 2025 PK
In today’s fast-paced and compliance-driven work environment, tracking employee training is no longer optional—it's essential. Whether you're an HR manager,
Dynamic Chart on User Form
Charts and Visualization VBA

VBA: Dynamic Chart on User Form

November 21, 2018February 25, 2025 PK
Creating the Chart on a VBA user form is quite interesting. We have created 4 KPI Charts – Battery Chart,
Enable Macros in Excel VBA
VBA

4 Easy ways to Enable Macros in Excel VBA

February 17, 2025February 17, 2025 PK
Are you tired of manually repeating the same tasks in Excel? Macros can automate your workflow and save you time!

Post navigation

Custom Visual: Liquid Fill Gauge in Power BI
Shell Function in VBA with Example

Number of items in cart: 0

  • Your cart is empty.
  • Total: $0.00
  • Checkout

Join Our Course

  • Excel Pivot Tables for Data Analysis

Top Categories

  • Charts and Visualization (155)
  • Dashboard (1,229)
  • Excel Tips and Tricks (185)
  • Power BI (445)
  • Power Pivot (73)
  • Power Point Visualization (4)
  • Power Query (1)
  • Predictive Analytics (5)
  • Productivity (2)
  • Templates (1,152)
  • VBA (186)

Download Categories

  • Calendars (54)
  • Charts (131)
    • Animated Charts (5)
    • Comparisons (53)
    • Gantt Charts (7)
    • Heatmaps (1)
    • Info-graphics (44)
    • Progress Charts (32)
    • Speedometers (4)
    • Timelines (2)
  • Checklist (229)
  • Dashboard (513)
    • Excel Dashboard (25)
    • KPI Dashboard (366)
    • Power BI Dashboard (122)
  • Data Analysis (12)
  • Excel Templates (73)
  • Excel VBA Tools (45)
  • Financial Tools (9)
  • HR and Payrolls (19)
  • Inventory Management (6)
  • Product (11)
  • Productivity (1)
  • Project Management (15)
  • Sales and Marketing (13)
  • Utilities and Converters (6)
  • VBA Automation (27)
instant= new adsenseLoader( '#quads-ad1-place', { onLoad: function( ad ){ if (ad.classList.contains("quads-ll")) { ad.classList.remove("quads-ll"); } } });

Latest Articles

Trucking Companies Dashboard in Excel

November 26, 2025November 26, 2025 PK

Financial Event Calendar in Excel

November 26, 2025November 26, 2025 PK

Poultry Farming Dashboard in Excel

November 26, 2025November 26, 2025 PK

Insurance Claim Dashboard in Power BI

November 26, 2025November 26, 2025 PK

Venture Capital Dashboard in Power BI

November 26, 2025November 26, 2025 PK

Popular Articles

Finance and Accounting Risk Management KPI Dashboard in Excel

April 23, 2025April 23, 2025 PK

Project Task Assignment Tracker in Excel

April 17, 2025April 17, 2025 PK

Employee Engagement Dashboard in Excel

September 26, 2025September 26, 2025 PK

E-learning Apps Dashboard Power BI

November 22, 2025November 22, 2025 PK
Project Management Student Dashboard

Project Management Student Dashboard in Power BI

May 19, 2024February 20, 2025 PK

Read More about..

  • Advanced Excel
  • VBA Course
  • Dashboard
  • Chart and Visualization
  • VBA Tips
  • Excel Tips and Trics
  • Our Excel Products
  • About US
  • Contact Us

 

Subscribe to our Newsletter



Download Dashboards

  • Project Management Dashboard
  • Zonal Dashboard
  • Sales Dashboard
  • Outbound Dashboard
  • A Quick Dashboard
  • C-SAT Dashboard
  • Performance Dashboard
  • Process Dashboard
  • Incentive Dashboard
instant= new adsenseLoader( '#quads-ad2-place', { onLoad: function( ad ){ if (ad.classList.contains("quads-ll")) { ad.classList.remove("quads-ll"); } } });

Popular Tags

Business Analytics business intelligence checklist template Conditional Formatting Customer Satisfaction data analysis Data visualization Event Management event tracker Excel excel-kpi-template Excel calendar excel checklist Excel Dashboard Excel dashboard template Excel Formula Excel formulas Excel KPI Dashboard Excel Template Excel Templates Excel Tips Excel tools Excel tracker Excel Tutorial HR Analytics HR tools Info-graphics Inventory Management KPI analysis KPI Dashboard KPI Template KPI tracking performance dashboard Performance Metrics performance tracking Power BI Power BI dashboard Power BI Templates Productivity Project Management Risk management Task Management Task Tracker Task Tracking VBA
  • Excel and VBA
    • VBA Course
    • Shortcut Keys
    • Useful Formulas
    • Basic Charts
    • Advanced Chart
    • Sort and Filter
    • Pivot Table
    • Data Validation
    • Conditional Formatting
    • Auto Fill and Flash Fill
    • Find and Replace
  • DownloadsPopular
    • Excel VBA Tools
    • Dashboard
      • Excel Dashboard
      • KPI Dashboard
      • Power BI Dashboard
    • Charts
      • Progress Charts
      • Info-graphics
      • Animated Charts
      • Comparisons
      • Gantt Charts
      • Heatmaps
      • Speedometers
      • Timelines
    • Inventory Management
    • HR and Payrolls
    • VBA Automation
    • Utilities and Converters
    • Checklist
    • Calendars
    • Data Analysis
    • Excel Templates
    • Financial Tools
    • Project Management
    • Sales and Marketing
    • Productivity
  • Excel Dashboard
  • Templates
  • Tutorials
    • Charts and Visualization
    • VBA
    • Excel Tips and Tricks
  • Power BI
  • Template StoreNew
  • CoursesNew
  • About Us
  • Contact Us
Copyright © 2023 PK-AnExcelExpert.com - Privacy Policy
This website uses cookies to improve your user experience, analyze site traffic and serve targeted ads in accordance with our Privacy Policy ACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT