Full Version: Grouping Controls on a form
UtterAccess Forums > Microsoft® Access > Access Forms
bigdutch
I have a form which is to work alongside a manual process for our purchasing team. The process is split into clear steps and my table requires all fields to eventually be completed (when the process has ended.
One screen i have grouped the controls together that are part of the step (1of5, 2of5) etc. The intention is that once Step1 is done the user press a command button which will "disable" step 1 controls and save the userid and date of button press in the table.
Now i can do all what i need but have to enter specific control with the .enable = false instruction.
To save me messing about and to easily add/remove controls can i somehow group the controls via VBA and then just "group1.enable = true" rather than the 10 controls that make up group1 ?
dashiellx2000
You can use the Tag property of the controls to group them together and then check them during a loop:
!--c1-->
CODE
Dim ctl as Object
For each ctl in Me.Controls
    If ctl.Tag = "Group1" Then
        ctl.Enabled = False
    End if
Next ctl

HTH.
bigdutch
William - excellent - this is proving to be more useful than i thought sad.gif
Edited by: bigdutch on Thu Sep 4 11:03:37 EDT 2008.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.