Check user level

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Slaxer13
    New Member
    • Jun 2014
    • 106

    Check user level

    Hi ppl.
    Here i am again with another problem. I need to do a check on a user level on the form_load. I've created a variable named Niv as Integer. I want to give that variable the value of the current user level. How?

    Appreciate any help, Slaxer13
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3662

    #2
    Slaxer,

    What do you mean by "User Level"? I have personally assigned user permissions in my DB, but I don't know what you mean in your case. Please explain.

    Comment

    • Slaxer13
      New Member
      • Jun 2014
      • 106

      #3
      I have a table that contains:
      - Cod_User
      - Cod_Level (This one is connected to a table called tblLevel)
      - First Name
      - Last Name
      - Login
      - Password

      Now i have a login form in which the user chooses its username from a combobox and puts its password in a textbox.
      When he does that, if done correctly, the login form closes and the user goes to the main form. On that main form i want to know the level of the user that has made the login so that i can give him privileges to edit, delete and save, or if the level is not high enough, make him only able to look through the records. The user level goes from 1 to 5. I wish to read the level of the current user so that users with level equal or greater than 3 have the above mentioned permissions.

      Cumps,
      Slaxer13

      Comment

      • twinnyfo
        Recognized Expert Moderator Specialist
        • Nov 2011
        • 3662

        #4
        Hmmmmmmmmmmmmmm mmmmmmmmmm.....

        Have you read this: Creating User Permissions?

        But, to avoid an in-depth method of creating user permissions, It should be as simple as:

        Code:
        DLookup("[Cod_Level]", "tblWhateverYourTableNameIs", _
            "[Cod_User] = '" & WhateverControlOrVariableYouAreUsing & "'")
        However, since the access level of the user affects every aspect of the DB, it may be wise to use a set of Global Variables (see the article) which carry on throughout the DB.

        Hope this helps!

        Comment

        • Slaxer13
          New Member
          • Jun 2014
          • 106

          #5
          I was actually reading it because before you talked about permissions and i found it. I'll give it a careful read and tomorrow i'll tell if anything is needed 'cause my head has reached its limit for pc's today xD and my nation is goigng to play so access is going to sleep xP

          Thanks for the help ;)
          Slaxer13

          Comment

          Working...