Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

2.27 Creating a Multi User Login System in Access VBA

Loading...

Sign in or sign up now!
96,190
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jul 22, 2008

Creating a multi-user login form to password protect different areas of your database
Here's the code:
Username.SetFocus
If Username = "staff1" And Password = "staff1" Then
MsgBox "Access Granted", vbInformation, "CD Shop"
MsgBox "Welcome", vbInformation, "CD Shop"
DoCmd.Close
DoCmd.OpenForm "F_Switchboard"
ElseIf Username = "staff2" and Password = "staff2" Then
MsgBox "Access Granted", vbinformation, "CD Shop"
MsgBox "Welcome", vbinformation, "CD Shop"
DoCmd.Close
DoCmd.OPenForm "F_Switchboard"
ElseIf Username = "manager1" and Password = "manager1" Then
MsgBox "Welcome, Manager", vbinformation, "Manager Area"
MsgBox "Please Exercise Caution When Altering Back End", vbinformation, "Manager Area"
DoCmd.Close
DoCmd.OPenForm "F_Switchboard_Manager"
Else
MsgBox "Please re-enter your Username and Password."
End If

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (Firchild)

  • Awesome, Thanks! Something silly but I can't find it in properties, how do you make the password text box, use a * symbol instead of the actual letters?

  • @iProRyan It should be under 'password characters' I'm sure it's in properties!

  • @Firchild After some research, I found that it comes under "Input Mask" and then "Password" in the properties windows.

  • @iProRyan Ahh, I knew it was there somewhere!

  • May I ask permission to use this coding in my 12th grade school project, I'll make sure I cite from where I got it.

  • @tareksul Of course, that's what it there for!

Top Comments

  • This is designed for A-level Computing where marks are gained for coding. Hence, we use code, as this is meant to prepare students for more advanced use of VB, C++/CSharp and the ilk. Agreed, it would be easier to use a table, but the examiners would pan it as it shows little or no coding ability.

see all

All Comments (20)

Sign In or Sign Up now to post a comment!
  • thanks a lot!

  • I'm doing GCSE I.T at the moment, and currently I'm writing a report, explaining how the current very simple database can be improved for the better. Whether I should be talking about creating a Login/Password and explaining how the coding allows the system to operate I don't know, but hopefully it'll gain me a few marks for perhaps research I've carried out.

  • Brilliant Video Firchild - very helpful and easy to understand.

    If possible, please could you help me with an urgent request - can you please upload a tutorial on how to create a multi user login system using data from a table in MS Access - the Login form will then check whether the data entered matches the data in the table.

    Thank you

  • hey, I want to save user accounts' username and password as a user setting but i don't think there is code to do that. if anyone knows if this is possible or if there is a different way to do it please reply.

    Thanks in advance,

    Joshua

Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more