Can anyone help me with vba code that can compare two fields from two different table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Samarko65
    New Member
    • Jun 2015
    • 2

    Can anyone help me with vba code that can compare two fields from two different table

    I am developing a database to check staff attendance. I have two unbound forms, one as a,login form, and the other as a navigation form. I have four tables. They are tbl_Security1, tbl_Security2, tbl_User1, and tbl_User2.
    Tbl_Security1 contains security_ID1 (number), and securityLevel_1 (number) (Admin, and User) as security levels.
    Tbl_Security2 contains the ff: Security_ID2 (autonumber), and Security_Level2 (short text), (developer).
    Tbl_User1 contains the ff: User_ID, User_Name, Password, and then User_Security (linked to SecurityLevel_1 in tbl_Security1).
    Tbl_User2 also contains the ff: User_ID2 (autonumber), User_Name2 (short text), Password2 (short text), and User_Security2 (number), (Developer) (linked to Security_Level2 in tbl_Security2.
    Now I need a vba code that will look into both tbl_User1 and tbl_User2 to check the fields Password and Password2 respectively so that if the txtpassword on the login form is same as any of them in the tables then permission is granted. The same applies to the name fields in both tables.
    Also I want the code to restrict users from accessing Admin and Developer pages on the navigation form. I also want the Admin to have access to only Admin and User pages but not Developer page. I also want Developer to full access to all pages.
    Thank you all
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    You have two questions here we normally ask for the to be only one per thread :)

    The following will cover both of your questions:

    Insights: How To Create User Permissions and Customized Menus in MS Access

    You might also consider the following:
    >Thread>Ms Access DB Users>Post#6 especially the part about encrypting passwords.

    Finally, There is really no fool-proof method in MSACC to prevent a knowledgeable user from bypassing anything you setup security wise. The closest I've found is in the post#6 link above. If you need anything very secure you'll need to move to an more mature RDMS>

    Comment

    • Samarko65
      New Member
      • Jun 2015
      • 2

      #3
      Thanks a lot Zmbd for your help, but I think this is too much for me to chew. I will try and send the database across including some codes I have written to see if any of you can help.
      Thank you.

      Comment

      • zmbd
        Recognized Expert Moderator Expert
        • Mar 2012
        • 5501

        #4
        You will find that many of the experts/moderators are either unable to open the attachments because we work in secured environments and provide help between tasks (ie - me :) ) or unwilling to open code from an unknown source.

        Both links I provided go into a great bit of detail. If you get stuck on any of it we can provide guidance there... :)

        TBH: your setup sounds a bit overly complex.
        Last edited by zmbd; Jun 10 '15, 10:12 PM.

        Comment

        Working...