Simple Login using MS Access 2007
Hi. I'm sharing this simple Login Form which I created using MS Access. I hope this will help Access newbies to become more comfortable with the program. I'm sure there are a number of ways to do this...
Simple Login using MS Access 2007
Hi.
I'm sharing this simple Login Form which I created using MS Access. I hope this will help Access newbies to become more comfortable with the program. I'm sure there are a number of ways to do this (perhaps much better than this) but I did what I could to make this simple and straight-forward.
I. Access Objects in this application:
A. Table:1. tblUsers - table for application users
B. Forms:1. frmLogin - start-up form **User Name - Erick, Password - erick **User Name - Billy , Password - billy
- frmMenu - opens when user supplies correct user and password at Login form
C. Module1. GVar - here is where I declared my Global variables 'strUser' and 'strRole'
II. Feature
frmLogin:Prompts if the User combobox and/or Password text box has no entryPrompts if the user types another name which isn't included in the listProgram closes when the user enters 3 consecutive wrong passwordLogin Form closes when correct password is supplied, greets the user, and opens the frmMenu.Sets the value of strUser and strRole global variables which shall be used throughout user session.
frmMenu:User name and role is displayedCommand button is enabled or disabled based on the value of strRole (enabled for 'Admin' and disabled for 'Encoder'
III. Tips for newbiesLearn and be more comfortable using the If... Then... Else StatementLearn how to declare variables and variable scoping (Private, Public, Global)Dlookup function parameters and syntax
IV. Gotcha MomentDocmd.Close in frmLogin prompts and runtime error 2585 so be sure to include the On Error Handler line
Hope this helps...
Screenshots
Download Project
