469,366 Members | 2,311 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,366 developers. It's quick & easy.

How to show available forms and controls for a specific operator after login?

Hello. I want to integrate roles and permissions for a specific operator after they log in. Is there a way to handle this. If so please ldt me know and ill give more details. Please answer. Thanks. Ryno
Dec 2 '10 #1
6 1311
207 100+
The way I have done this in the past is to create a field in my Users table called Role. Then I just do a query off the role field and check to see if they have that Role before letting them open a form or update some information.
Dec 2 '10 #2
Ok. Do you maybe have a sample databare how you did it. My goal is to set up a list of roles an then tick them off which access the user has.
Dec 2 '10 #3
207 100+
Sadly I can't provide any samples because I did them for work, but I can give a clearer explanation. So I have a table Users with the following fields.

NetworkName, FullName, Role

When the User launches the application on the first form they see in the On Open event I run a query similar to this one.

Select FullName, Role FROM Users where NetworkName = '" & Environ("UserName") & "'";

If they don't exist in the Users table then I kick them out of the application and tell them to contact me.

On the first form I have two hidden text boxes called tbFullName and tbRole. Once I have gotten the result of the query I load these text boxes up with the information. This first form stays open the entire life of the application so any time I need to check their role I just check the text box and see what it is.

Hope this helps.
Dec 2 '10 #4
Ok, so is there certain buttons that they cant use if they dont have access to it. For e.g. In a purchase order, if they are a buyer, they can create a p/o and if there is a button to approve the po its disabled because only a manager can approve orders. Do you understand where im coming from. I want to grant users different access.
Dec 2 '10 #5
207 100+
In that situation I would have some code in the Forms on Open event like this. I am assuming the names of your roles and your buttons

Expand|Select|Wrap|Line Numbers
  1. If(Forms!frm_MainMenu.tbRole = "Manager") Then
  2.     me.btnApprove.Enabled = true
  3. Else
  4.     me.btnApprove.Enabled = false
  5. End if
Dec 2 '10 #6
Can you maybe attach a sample database? I need to see this practically to understand it. Please. Thanks
Dec 3 '10 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by FaciCAD | last post: by
3 posts views Thread by Gene Hubert | last post: by
2 posts views Thread by mustafa.rabie | last post: by
2 posts views Thread by =?Utf-8?B?bGFyc2dyZWdlcnNlbg==?= | last post: by
1 post views Thread by thomasjbs | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.