G.15. The Section Object

Every form or report contains several Section objects including the header, footer, and detail sections. Each section has a number of properties and methods you can use within your code.

A Section object has only one method: SetTabOrder. It enables you to programmatically set the tab order for all controls in a section. Calling this method is the equivalent of using the Auto Order button in the Tab Order dialog box.

G.15.1. Section Object Properties

The properties of the Section object are described in the following table.

PropertyData TypeDescription
AlternateBackColorLongSpecifies the alternating row color for a section. It is now easy to change the row color for every other section on a form or report!
ApplicationApplication objectReturns the currently active application.
AutoHeightBooleanIndicates whether a section should grow automatically when controls are resized.
BackColorLongSpecifies the color for the interior of a section.
CanGrowBooleanTrue if you want the section to automatically grow to print or preview all data within the section.
CanShrinkBooleanTrue if you want the section to automatically shrink to print or preview only the data within the section (with no extra space).
ControlsControls collectionReferences all of the controls within the section.
DisplayWhenByteControls which sections you want displayed on screen and in print.
EventProcPrefixStringUsed to get the prefix portion of an event procedure name.
ForceNewPageByteSpecifies when sections ...

Get Access™ 2007 VBA Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.