rrhandle8
asked on
User permissions in Access 2010
How do you create permissions in Access so user "A" and edit data, but user "B" can only view data?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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?
You can set all of your Forms to be ReadOnly when opening them like this:
Me.AllowEdits = False
Me.AllowAddition = False
Me.AllowDeletes = False
This would allow the user to view data, but not modify it.
Of course, if you're allowing users access to your Tables or Queries, then you have no control over that.
Me.AllowEdits = False
Me.AllowAddition = False
Me.AllowDeletes = False
This would allow the user to view data, but not modify it.
Of course, if you're allowing users access to your Tables or Queries, then you have no control over that.
ASKER
Scott, possible to loop through all forms when database opens, and set the properties you stated?
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").txtUs erLevel > 1 Then
Me.AllowEdits = True
Me.AllowDeletes = True
ect ect
Else
Me.AllowEdits = False
etc etc
End If
Or you can do this:
Me.AllowEdits = Forms("Hidden_Form").txtUs erLevel > 1
This would set AllowEdits to TRUE if the Userlevel is greater than 1, otherwise it would set it to FALSE.
If Forms("Hidden_Form").txtUs
Me.AllowEdits = True
Me.AllowDeletes = True
ect ect
Else
Me.AllowEdits = False
etc etc
End If
Or you can do this:
Me.AllowEdits = Forms("Hidden_Form").txtUs
This would set AllowEdits to TRUE if the Userlevel is greater than 1, otherwise it would set it to FALSE.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.