• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 14. Working with Reports > Using VBA to Determine Group Properties

Using VBA to Determine Group Properties

You might not realize that a group’s header and footer have corresponding events, like other report sections, and that you can use these events to modify reports on the fly—even adding new sections as needed.

Referring to Report Components in Code

Whether working with sections or groups, you need to know how to reference the appropriate area or level. To reference a report section, use the report’s name or number. For instance, you can refer to a report’s Detail section using the following syntax:

Reports(reportname).Detail

where reportname is a string that identifies the report by name. Detail is the actual name of the section. Or, you can use the following form:

Reports(reportname).Section(0)

or even

Reports(reportname).Section(acDetail)

When referencing group levels, use the same form as sections:

Reports(reportname).GroupLevel(index).property
						

A group level is actually an object, so you can use an object variable as follows:

Dim glGroup As GroupLevel
Set glGroup = Reports("BillingReport").GroupLevel(0)



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint