Misleading Grouping Claim (6 Viewers)

PowerApps allows you to select a number of controls on a screen and create a group on them. Some properties of the group then apply to objects which are now part of it. One of the most useful I've found it to make the group visible. All of the members of that group are displayed or hidden without having to do so for each of them.

That would be a really cool feature to have in Access.

I use the tag property in code for grouping related controls to make them visible, hidden, locked, unlocked, clear their values, etc.
 
Same idea, but more code required I would expect.
Code:
Private Sub GroupVisibility(GroupName As String, Visibility As Boolean)
 
Dim ctl As Control
 
   On Error GoTo locErrorHandler
 
   For Each ctl In Me.Controls
      If InStr(ctl.Tag, GroupName) > 0 Then ctl.Visible = Visibility
   Next ctl

locExitHere:
   Exit Sub

locErrorHandler:
   ErrorHandler Me.Name, "GroupVisibility"
   If gErrorResponse = 1 Then Resume
   If gErrorResponse = 2 Then Resume Next
   Resume locExitHere

End Sub
 
Code:
Private Sub GroupVisibility(GroupName As String, Visibility As Boolean)
 
Dim ctl As Control
 
   On Error GoTo locErrorHandler
 
   For Each ctl In Me.Controls
      If InStr(ctl.Tag, GroupName) > 0 Then ctl.Visible = Visibility
   Next ctl

locExitHere:
   Exit Sub

locErrorHandler:
   ErrorHandler Me.Name, "GroupVisibility"
   If gErrorResponse = 1 Then Resume
   If gErrorResponse = 2 Then Resume Next
   Resume locExitHere

End Sub
Simple enough. (y)

But with a true Group, it would be:

Me.GroupofControlsName.Visible = visibility

and no need to poll all of the controls for the presence of the tag.
 

Users who are viewing this thread

Back
Top Bottom