How to Create Secure Access Forms for Users and Supervisors
Question details
The user needs to set up role-based access in a database where standard users can only edit their own entries, while supervisors have expanded viewing and editing rights.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Designing a multi-user database system requiring different form views and edit permissions based on the user's role.
- Observed behavior
- The goal state is a secure system with a normalized database structure, login validation, and role-directed form access.
Before building forms, ensure you have a normalized relational database design with separate tables for Users (including their roles and supervisor IDs) and Data. Back up your database before implementing new security logic or altering table structures.
Build a Role-Based Access System with a Login Form
Use a normalized user table and a custom login form to validate users and direct them to their appropriate interfaces based on their assigned role.
Designing a multi-user system within Access requires separating the data layer from the application layer. Relying on a single table is inadequate for complex permissions.
A relational structure with a dedicated Users table is essential for secure role verification. By capturing the user's role upon login, you can dynamically filter records and restrict field-level edits.
Design a table containing UserID, Username, Password, Role (User or Supervisor), and SupervisorID fields to properly categorize your users.
Ensure your main data tables (e.g., Responses, Questions) include a UserID foreign key to link individual records to specific users.
Create an unbound form with text boxes for Username and Password, and a 'Login' command button to handle authentication.
On the Login button's On Click event, use the DLookup function in VBA to verify the credentials and check the user's designated role in the Users table.
Within the VBA code, use DoCmd.OpenForm to open a restricted form filtered by UserID for standard users, or a comprehensive management form for supervisors.

Discover WPS Office for Your Data Management Needs
While Microsoft Access handles complex relational databases, many teams rely on spreadsheets for data collection, collaboration, and permission management. WPS Spreadsheets offers a lightweight, highly compatible alternative to Excel for organizing user data, collaborating securely, and managing permissions without complex database coding.
- 1. Organize Your Data: Open WPS Spreadsheets and organize your data into clearly defined columns for users and supervisors.
- 2. Apply Protection: Navigate to the Review tab and click 'Protect Sheet' to restrict unauthorized editing.
- 3. Set Range Permissions: Use 'Allow Users to Edit Ranges' to grant supervisors access to specific cells while locking them for standard users.

Frequently Asked Questions
Can I restrict standard users from seeing supervisor fields in Access?
Yes. You can achieve this by creating a specific query or form for standard users that simply omits the supervisor-only fields, or by using VBA to hide and disable those specific controls based on the logged-in user's role.
Why shouldn't I use a single table for a multi-user Access database?
Using a single table causes data redundancy and makes it extremely difficult to enforce row-level or field-level security. A normalized relational database separates user credentials, forms, and responses, which is essential for secure access control.
How do I filter an Access form so a user only sees their own records?
You can use the OpenForm method in VBA with a WhereCondition parameter. For example, using DoCmd.OpenForm 'YourForm', , , 'UserID = ' & CurrentUserID ensures the form only loads records matching the logged-in user.
Is it safe to store passwords in a plain text Access Users table?
No, storing passwords in plain text is a security risk. It is highly recommended to implement a hashing algorithm in VBA to encrypt passwords before storing them in your Users table.




