CreateGroupLevel Method Example
The following example creates a group level on an OrderDate field on a report called OrderReport. The report on which the group level is to be created must be open in Design view. Since the header and footer arguments are set to True (–1), the method creates both the header and footer for the group level. The header and footer are then sized.
Sub CreateGL()
Dim varGroupLevel As Variant
' Create new group level on OrderDate field.
varGroupLevel = CreateGroupLevel("OrderReport", "OrderDate", _
True, True)
' Set height of header/footer sections.
Reports!OrderReport.Section(acGroupLevel1Header).Height = 400
Reports!OrderReport.Section(acGroupLevel1Footer).Height = 400
End Sub