I have an Access2003 form where I wanted to group several controls together and change visibility programatically, though VBA code.
Is this possible? I do know that I can group items through Format -> Group, but if I do that, how do I refer the the entire group in my code?
Thank you
You could place all the controls in a group box control then change the visibility of the group box itself.
You could also add a value in the tag property of each control you want to group, then in VBA loop through the control and check for that value and change the visibility there.
Set the tag property of all the controls you want to group to something like groupABC or whatever you wish.
Then somewhere in your code use this to loop through the form controls and check for it.
Dim ctrl As Control
For Each ctrl In Me.Controls
If ctrl.Tag = "groupABC" Then
ctrl.Visible = False
End If
Next
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With