Results 1 to 6 of 6
  1. #1
    banpreet is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2016
    Posts
    117

    See different stuff on forms depending on user

    Hi Guys,

    I don't know if this is possible but all help is appreciated. I have test request forms with 3 approval sections on it for managers to sign. My boss said I should get rid of those sections because the users shouldn't have access to approval otherwise they can just sign, so he wants the approvals section to be only seen by other managers who looking to approve the Test Request forms. I don't know if this is the right way to go or possible, but I have created a button on the main menu password protected, so managers have access to a search form that the manager will type in maybe a date or something for the form that are looking to approve, and then the same form will open the user inputted but this time the manager will see the approval sections on the same form, and then can sign them. Please let me know if this possible.

    Thanks!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    You will need a tUsers table, with userID and Level
    when user opens the db, the main menu form will open and read the userID. Then lookup that persons rights in order to enable/disable controls.

    Code:
    sub form_load()
       vUserID =  Environ("Username")
       vLevel = Dlookup("[Level]","tUsers","[userID]='" & vUserID & "'")
    
       select case vLevel
             case "A"  'admin 
                 'all is enabled
             case "U"  'normal user
                 txtBox1.enabled = false
                 txtManager.enabled = false
       end select
    end sub

  3. #3
    banpreet is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2016
    Posts
    117
    Do I type in this code for the subform load on the Test Request form after the manager clicks searches for the form and clicks the button to open up the form? Thanks, and srry I am a noob

  4. #4
    banpreet is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2016
    Posts
    117
    or better yet is there a way that if the Manager Chooses case "A", a password box comes up?

  5. #5
    banpreet is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2016
    Posts
    117
    I typed in the code, how do I look up the persons rights, sorry I am not clear on this

  6. #6
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    you must make a table , tUsers.
    userID, name, level

    of everyone using the db. Enter all names and levels. you can hardcode a password if the user is Admin.

    vPass = inputbox("Enter password","Admin Entry")
    if vPass <> "Mypassword" then docmd.close

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

Similar Threads

  1. Replies: 6
    Last Post: 01-22-2016, 03:34 PM
  2. Opening Certain Forms Depending on Inputs
    By thepigslayer in forum Access
    Replies: 4
    Last Post: 07-26-2015, 10:01 AM
  3. Need different amounts of data depending on a user input?
    By parkerjallen in forum Database Design
    Replies: 2
    Last Post: 11-13-2012, 03:17 PM
  4. Replies: 6
    Last Post: 10-11-2012, 02:19 PM
  5. Need help figuring out stuff
    By Buakaw in forum Access
    Replies: 3
    Last Post: 01-31-2011, 02:59 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