Rivercity Technology Services LTD Logo
HomeAbout Us
Technology Services
Icon showing a support technician
IT Support Services
Cybersecurity Risk Management at one predictable flat rate.
Icon of light bulbs on a laptop screen
IT Consulting
Business optimization through the smart use of technology.
Icon showing a hand holding a phone
Business Phone Services
VoIP Telephone solutions from RCT. 
Icon showing a database and a cloud
Backups & Recovery
Cloud & On Premise - ready to recover!
Icon showing computer code on a monitor
Software Development
Web & Mobile App development
Icon showing website wireframes
Website Development & Hosting
Web design and full hosting & maintenance packages!
Icon showing an envelope being opened
Modern Email Management
Microsoft 365 email provisioning, security & management.
“You’re giving me the ‘it’s not you, it’s me’ routine? I invented ‘it’s not you, it’s me.’ Nobody tells me it’s them not me; if it’s anybody, it’s me.”
- George Costanza
Learning CenterContact Us
Book A Consultation
Illustration of a person writing a blog post with a pencil

Integrating security into your Access database

There is nothing easy when it comes to trying to bring security into your Access database.  Ideally you would use SSO and talk to Active Directory.  Or SQL and have that applied.  But when all things are considered if you just want a simple solution to better handle options for users, and are not worried about password integrity...then this is basic and works.  NOTE:  it is NOT hacker proof, and NOT encrypted passwords.  That is another lesson on another day!

Create a Table called [TblEmployees].

Create fields in it called Role, and Empcode.  Role holds their role, and EmpCode holds their user ID they have when they login.

Assign various roles to the users in the database.

Create a login form that lets them pick their user, enter their password, and login. (I have a sample form for this if you need it).

Set a tempvar which holds the UserID (EmpCode).

Run the following code on the OnLoad event of a form:

As you can see this does a dlookup to get the role of the user using the tempvars.  It then hides or shows certain controls (buttons, fields, labels) based on the role.  it can also open or not open other forms, etc...sometimes I will call a form using acFormEdit, other times I call it using acFormReadOnly.  it depends on their role, the client, or many other variables.

Easy right?!

Jeff Shirley
Article Written by Jeff Shirley
Related Articles
Featured image
Your Guide to Managed Website Hosting
Creating a website is only the first step. Keeping it online and accessible to visitors 24/7 involves a lot of additional work. Hosting your site means choosing...
2022 - Copyright, All Rights Reserved