Results 1 to 8 of 8
  1. #1
    neuhur is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    11

    User Login That Disables Certain Buttons

    Hello Everyone,

    Please help.

    I created a form with an "add record" and "delete record" button. I need to create a simple login form for 2 users (user1 and admin1) that will disable able the "delete record" button when the user, "user1" logs in. Whenever the user, "admin1" logs in, then both "add record" and "delete record" buttons are enabled.

    What is the easiest way to accomplish this? Thanks in advance for your help!




    Thanks,
    Neuhur

  2. #2
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    Well my first question is, do you plan on adding any more users in the future? Depending on how you answer that could go in two completely different directions.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    When user logs in, need to store their ID or privileges code somewhere so it can be referenced in subsequent procedures. I store value in a textbox on a form that never closes (main menu). Then when another form is opened, code in form Open event is like:

    If Forms!MainMenu.tbxCode = "user" Then
    Me.btnDelete.Visible = False
    End If
    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.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    If you don't want to make the button invisible, you could disable it ( it would still appear but inoperable).

    I'm not suggesting, just giving another option for consideration.

  5. #5
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    Quote Originally Posted by June7 View Post
    When user logs in, need to store their ID or privileges code somewhere so it can be referenced in subsequent procedures. I store value in a textbox on a form that never closes (main menu). Then when another form is opened, code in form Open event is like:

    If Forms!MainMenu.tbxCode = "user" Then
    Me.btnDelete.Visible = False
    End If
    You may also want to hide the login form so that no one accidentally closes it.

  6. #6
    neuhur is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    11
    Per the requirements, there will only be two users, "user1" and "admin1".

  7. #7
    neuhur is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    11
    That's a possible solution to test. How would I accomplish the enable/disable of the button based on what user logs in?

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    See post 3.
    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.

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

Similar Threads

  1. Multiple User login
    By Bradonnmorgan in forum Programming
    Replies: 2
    Last Post: 03-11-2013, 10:24 AM
  2. User Login
    By winterh in forum Forms
    Replies: 6
    Last Post: 03-14-2012, 06:01 PM
  3. Replies: 3
    Last Post: 09-22-2011, 03:35 PM
  4. Enable command buttons based on login
    By foxtet in forum Security
    Replies: 3
    Last Post: 07-26-2011, 05:11 AM
  5. Login and user levels
    By seanog2001 in forum Forms
    Replies: 0
    Last Post: 10-27-2009, 05:13 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