How do you create permissions in Access so user "A" and edit data, but user "B" can only view data?
Microsoft Access
Last Comment
PatHartman
8/22/2022 - Mon
Jim Dettman (EE MVE)
Nothing is built into Access to handle that.
Some add a security system in the form of a couple of tables. One for forms, with a permission flag for Open, Add, Edit, and Delete, and another for controls, with flags for enabling/disabling the controls.
The other way to do it is use a different data store rather than the ACE database engine. Something like SQL Server, which allows for security on tables and views to be set by user and/or group.
That doesn't really touch objects though, so most build something in Access.
Thanks guys. I wonder if I can make this simple. There are only two user types: full permissions and read only. Based on the user's login information could I make the database readonly? Or maybe use a second database just for logging in, and open the database as readonly for particular users?
Scott McDaniel (EE MVE )
You can set all of your Forms to be ReadOnly when opening them like this:
Scott, possible to loop through all forms when database opens, and set the properties you stated?
Scott McDaniel (EE MVE )
You just write them in the Open or Load event of the Form, based on the user login. In most cases, you'd have a hidden form somewhere that would store your "User Level", and your forms could refer to that:
If Forms("Hidden_Form").txtUserLevel > 1 Then
Me.AllowEdits = True
Me.AllowDeletes = True
ect ect
Else
Me.AllowEdits = False
etc etc
End If
Some add a security system in the form of a couple of tables. One for forms, with a permission flag for Open, Add, Edit, and Delete, and another for controls, with flags for enabling/disabling the controls.
The other way to do it is use a different data store rather than the ACE database engine. Something like SQL Server, which allows for security on tables and views to be set by user and/or group.
That doesn't really touch objects though, so most build something in Access.
Jim.