Enable/Disable controls by access level

esandoval

New member
Local time
Today, 18:04
Joined
Oct 14, 2009
Messages
5
Hi, I'm working with an application for the marketing department, this application has different forms with many controls (Combo box, list box, buttons, text box, etc.). On each screen some users can have access to all controls while other users can have access to some controls depending of their access level. The access level is determined by the group where the user id belong. If the Marketing Director want that some group have access to an specific control I have to open the code and change the code. My question is, Is there other way to manage a group of controls so I can enable some controls to one group and disable it for other group?
For example:
Having a form with all the controls names with check box and a combo box to select a group so I can check the control that I want to be enabled for the selected group instead to change the VBA code.

Thanks.
 
I put access level information in the Tag property of the control then loop through the controls in the OnLoad event to set the Enabled, Locked or Visible properties based on a comparison between the user's permissions and the Tag value. This is simple and fast.

You can use a similar but more complex technique to read the required status from a table of permissions. Use a DLookUp or Recordset to read the table of permissions. This is a neater solution because it can be changed without touching the design of the form.
 
Thanks Galaxiom, I will go with the tag solution, as you mention, is simple and fast.

Thank you very much.
 

Users who are viewing this thread

Back
Top Bottom