Solved

Restrict access to certain tabs on Access Form by who is logged in

Posted on 2016-11-10
5
28 Views
Last Modified: 2016-11-16
I am using an audit trail in my database based on this http://www.fontstuff.com/access/acctut21.htm. It captures the current user with Environ. Now I also need to restrict or hide the Medical tab in this employee database for confidentiality reasons. There are only about 4 people who will have full access so I wonder if there is a way to hide this tab for all users except the few that need access? I could code it directly into the module or maybe create a table that lists certain users with administrator level? Suggestions anyone? Thanks in advance!

I am using a navigation form so the path to the tab control will be a long one.
0
Comment
Question by:esbyrt
  • 2
  • 2
5 Comments
 
LVL 3

Assisted Solution

by:bfuchs
bfuchs earned 100 total points
ID: 41882952
I could code it directly into the module or maybe create a table that lists certain users with administrator level
I would do do the table option as it will not require a change to the program later on when users change, then have the forms on open module unhide those tabs.
0
 
LVL 34

Accepted Solution

by:
PatHartman earned 400 total points
ID: 41883008
I'll make a stronger statement.  Don't even consider hardcoding stuff like this.  Take the time to build an Admin interface so a user can administer security.  Plan ahead and consider what types of things you need to secure.  Sometimes you can simply use levels and then your forms check the level of the logged in user and compare it to the level needed for "this" form.  Again, I would take the longer path and create a table of forms with actions - read, update, delete and populate each with an appropriate level.  So UserPat is level 9 and can perform any action that requires level 9 or below.  So UserPat on formA might be able to read and update but not delete.  UserTom is level 2 and can perform any action that is level 2 or below.  At best, UserTom will be able to read formA.  Give yourself a decent range for levels so you can stick things in.

The alternatives get more complex.  You can assign people to groups and then map groups to specific actions.  This of course gives you better granularity.  You just have to determine the sensitivity of the data and the danger of the wrong people seeing or updating it.  All the while keeping in mind that Access isn't a particularly secure platform to begin with.  If you need more robust security, switch to a SQL Server BE and implement the bulk of the security there.
0
 

Author Comment

by:esbyrt
ID: 41886707
Hi. Sorry for the slow reply, I was away for the long weekend. So if I create a table of users and their associated levels, do I then have to check against the table each time the navigation form loads via the onload event or would I have to check as each form within the navigation form loads?

Can you tell me the syntax to hide the medical tab? It is on the frmEmployee under frmNavigation. The detail section has TabCtrl41 with the tab I want to hide called Medical.

Thanks!
0
 
LVL 3

Expert Comment

by:bfuchs
ID: 41886900
each time the navigation form loads via the onload event
thats correct.
with the tab I want to hide called Medical
try me.Medical.visible = false
0
 

Author Closing Comment

by:esbyrt
ID: 41890036
Thanks for the help! I am closing this question for now as things have come up and I don't have time to actually work on the database right now. Once I have time to dive back in I will post a more specific question if I run into problems. Thanks again!
PS  I split the points between both commenters, I hope that's ok?
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now