473,407 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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 1495
hype261
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
hype261
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
hype261
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
  6.  
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

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

Similar topics

0
by: jusa | last post by:
Hi, I wold like to get to a .Net apps forms/controls/properties. I've managed to start an app with Process.Start but can not figure out if possible/how to get to the started form. I would like...
0
by: Guowei Yang | last post by:
I'm a chinese c# user,now I'm writing a program of visiting SQL server.When I placed a DataGrid control in my web form and browsed it in IE,I couldn't find any record of database.Other web forms...
1
by: FaciCAD | last post by:
How to get available sheet for specific printer on my PC?
4
by: Dean Slindee | last post by:
Is there a shorter way of referring to another forms controls/events than creating a class hold forms, adding a form item each time a new form is loaded, and then looping thru the class of forms to...
3
by: Gene Hubert | last post by:
Is there a way to Visually Design Windows Forms Controls? For example, I have a class that inherits TextBox. Can I see a property sheet and a rendition of what it will look like as I develop...
2
by: mustafa.rabie | last post by:
Dear all, I am new to the .net 3.0 development. I am currently trying to develop a WPF (XAML) application using VS 2005 + Expressions blend. I created the window added buttons and managed all...
2
by: =?Utf-8?B?bGFyc2dyZWdlcnNlbg==?= | last post by:
Hi I have created a couple of Windows Forms controls in C# either by composition or by subclassing existing controls. I'm able to use these controls as ActiveX controls by using "register for...
3
by: Andy B | last post by:
Is there any way to use .net windows forms controls inside asp.net pages and not require that the client have .net access? I'm more the less thinking of mobile devices that don't have access to, or...
2
by: Andy B | last post by:
Is there any way to use .net windows forms controls inside asp.net pages and not require that the client have .net access? I'm more the less thinking of mobile devices that don't have access to, or...
1
by: thomasjbs | last post by:
Anyone know a consistent object reference to forms controls? I have 2 forms. The main form instantiates a 2nd form, creates some text and label objects on the 2nd form, hides itself and then...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.