Solved

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

Posted on 2016-11-10
5
73 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 37

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

729 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