Solved

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

Posted on 2016-11-10
5
52 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 4

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 35

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 4

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

821 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