O'Reilly logo

Access™ 2007 VBA Programmer's Reference by Armen Stein, Geoffrey Griffith, Rob Cooper, Teresa Hennig

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required