Results 1 to 4 of 4
  1. #1
    JMR is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2014
    Posts
    17

    How to create a User Hierarchy in Access 2019

    I have a split 2019 Access DB. I use passwords to limit access to non management users and I have heard that Access might have some sort of built in, or easily constructed, User Management system whereby I could create Admin, Management and User type users with different access to forms and reports. Is there any "How to" links anyone knows of that would be helpful for me to start learning about this process and the coding required?

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    I have a tUser table with their limitation code levels:
    cXavier, Adm
    Logan, Mgr
    JGrey, Usr

    then the db opens, grab the useriD
    then with that , grab their Level from the tUsers table.
    then enable buttons/objects:
    Code:
    public gvUserID, gvLevel
    
    sub form_Load()
    gvUserID = getUserID()
    gvLevel = getUserLevel()
    
    'then turn on/off buttons
    'all buttons start disabled
    btnAdmin.enabled = gvLevel = Adm
    btnManager.enabled =(gvLevel = Adm) or ( gvLevel = Mgr) )
    btnLookup.enabled = true  'all
    end if

    Code:
    Public Function getUserID() As String
    getUserID = Environ("Username")
    End Function
    
    
    Public Function getUserLevel() As String
    getUserLevel= Dlookup("[Level],"tUsers","[UserID]='" & gvUserID & "'") & ""
    End Function

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,858
    I just set a userlevel in a table tblUsers and then modified the switchboard form to only show relevant options?
    You cannot click what you cannot see.

    I hate the idea of presenting something to a user and when they click on it, they are told they are not allowed to use it Why bl**dy show it in the first place?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Please feel free to download and use my free utility: http://forestbyte.com/ms-access-util...access-levels/

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Send SMS using Access 2019
    By Raveen1609 in forum Access
    Replies: 3
    Last Post: 10-19-2021, 12:40 PM
  2. Replies: 23
    Last Post: 12-21-2020, 03:26 AM
  3. Hierarchy chart in Access
    By charly.csh in forum Access
    Replies: 4
    Last Post: 03-15-2016, 11:54 AM
  4. Replies: 17
    Last Post: 11-19-2015, 08:32 PM
  5. Replies: 4
    Last Post: 01-05-2013, 02:43 AM

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