Loop through subreports

  • Thread starter Thread starter Question Boy
  • Start date Start date
Q

Question Boy

How can one loop through all the subreports within a report?

I need to loop through all the subreports within a report to compare their
heights to set a variable = to the maximum value.

Thank you

QB
 
Found a solution, therer may be better ways, but this one seems to works.

Dim ctl As control
For Each ctl In Me.Controls
With ctl
Select Case .ControlType
Case acSubform
'Debug.Print ctl.Name & ": " & ctl.Height
If ctl.Height > iheight Then
iheight = ctl.Height
End If
End Select
End With
Next
 
Back
Top