Format Report Section Event

A Format event occurs for each section in a report before Microsoft Access formats the section for previewing or printing. This event takes the following two arguments:

Cancel — Determines if the formatting of the section occurs. To cancel the section formatting, set this argument to True.

FormatCount — An integer that specifies whether the Format event has occurred more than once for a section. If a section does not fit on one page and the rest of the section needs to be moved to the next page of the report, the FormatCount argument is set to 2.

Part IV

Use the Format event in the appropriate report section for changes that affect page layout. For changes that don't affect page layout, use the Print event for the report section (see Hands-On 25-10 later in this chapter).

Table 25-1: Effect of format event on report sections

Report Sections

Description of Format Event

Detail

The Format event occurs for each record in the section just before Microsoft Access formats the data in the record. You can access the data in the current record using the event procedure.

Group Headers

The Format event occurs for each new group. You can access the data in the group header and the data in the first record in the Detail section using the event procedure.

Group Footers

The Format event occurs for each new group. You can access the data in the Group Footer and the data in the last record in the Detail section via an event procedure.

The event procedure in Hands-On 25-8 demonstrates how to make reports easier to read by shading alternate rows.

0 0

Post a comment