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