robertrobert905
Board Regular
- Joined
- Jun 27, 2008
- Messages
- 139
I would like to group all the objects under the label "1" into one group, and all the objects under label "2" into one group and so on.
This way I can deal with them in 25 groups with ease instead of hundreds of individual objects.
The purple boxes are textboxes and the gray boxes are labels
the only way that I know to group objects is to group ALL the textboxes together is with this code, which Norie showed me.
But I need to group them based on the last digit in their name not their type. E.G everything under label one is called P3LB1, P3TXT1_1, P3TXT2_1 etc.
Also once I group them together how do I show or hide them as a group?
This way I can deal with them in 25 groups with ease instead of hundreds of individual objects.
The purple boxes are textboxes and the gray boxes are labels
the only way that I know to group objects is to group ALL the textboxes together is with this code, which Norie showed me.
Code:
For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Then
ReDim Preserve TextBoxes(1 To I)
Set TextBoxes(I).TextGroup = ctl
I = I + 1
End If
Next ctl
But I need to group them based on the last digit in their name not their type. E.G everything under label one is called P3LB1, P3TXT1_1, P3TXT2_1 etc.
Also once I group them together how do I show or hide them as a group?
