Solved

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

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

864 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