Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2016-11-10
5
Medium Priority
?
89 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 400 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 39

Accepted Solution

by:
PatHartman earned 1600 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
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.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

715 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