Results 1 to 4 of 4
  1. #1
    an1bone is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    9

    Multi user login form

    Hello,



    I am trying to create a multi user login form for my Access 2010 database. I will have 2 different types of users (administrator and staff). The administrator will be able to see all tables and forms and edit/ add to them. The staff will only be able to view a switchboard form and 2 forms (as well as using combo boxes to look up specific records). However, I don't want the staff to be able to view the tables or edit anything. I am still fairly new to Access and especially VBA, so the more details and explanations you can give me, the better!

    Thanks!!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,972
    You want to allow administrator (is that you) to view and access objects from the navigation pane?

    Simplest approach is to set database options that disable the ribbon, hide navigation pane, disable shortcut menus, disable function keys. This will make it difficult although not impossible for anyone to get to edit mode for the db. Simply hold down shift key when opening db to bypass most of these option settings and enable editing of anything. Anything beyond this will require a bunch of code. Review https://www.accessforums.net/access/...ers-48543.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    an1bone is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    9
    There will be several administrators, so I need something more secure than just holding down the shift key. The login screen should appear when the db is opened, so is there a IF, ELSE IF code for administrator vs. staff priviledges?

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,840
    If you disable the ribbon or any shortcut menus, I think you will lose some functionality that might prove to be a problem, such as printing a form or report.

    I would dispense with the idea of a login form. Store the user level in your user table (could be a lookup field on tblLevel). The levels should be in their own table with a numbered sort order field. When required, you get the tblUser.Level and compare that to the result of functions like Environ or code that gets the user computer id or network login id. You could store the user data in Public variables. Then any form's open event can retrieve the user level and cancel the opening or set the visibility of controls based on the level. The reason for the sort order is to simplify allowing access for more than one level (such as Admin and Supervisor, but not User). The logic would be "allow if tblLevel.SortOrder>2 where tblUser.Level = loggedinUser.Level" (from the function). This way, database startup is seamless and if the person attempting to login is not in the table, they have no access. You also do not have to deal with passwords. If you weren't going to require a password, it seems even less desireable to have a login form. In support of your goal, the db should be split and the front end made into an mde or accde. Your backend tables can be linked to the front end with a password (which you better not forget). Create an "Easter Egg" (some sort of gamer thing, I believe) such as when you double-click on it, the db "AllowBypassKey" property is cycled. This will prevent anyone from getting behind the protection that the bypass feature provides. These things can give you a lot of protection, but you will never be able to 100% secure everything from the most prying eyes using Access.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 01-26-2013, 11:38 PM
  2. User Login Form
    By glen in forum Forms
    Replies: 21
    Last Post: 09-17-2012, 09:09 AM
  3. Multi users login form
    By johnwatkins35 in forum Forms
    Replies: 3
    Last Post: 05-15-2012, 11:39 PM
  4. Multi- User Login
    By Tom Lovick in forum Access
    Replies: 1
    Last Post: 02-11-2012, 12:20 PM
  5. Replies: 3
    Last Post: 09-22-2011, 03:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums