Print Event

Applies To

Report Section.

Description

The Print event occurs when data in a report section is formatted for printing, but before the section is printed.

Remarks

For a report detail section, the Print event occurs for each record in the section just before Microsoft Access prints the data in the record. A Print event procedure or macro has access to data in the current record.

For report group headers, the Print event occurs for each new group, and a Print macro or event procedure has access to data in the group header and the first record in the detail section. For report group footers, the Print event occurs for each new group, and a Print macro or event procedure has access to data in the group footer and the data in the last record in the detail section.

You can use the Print event to run a macro or execute an event procedure only after Microsoft Access has prepared data for printing on a page. For example, you can calculate running page totals that are printed in the page header or footer.

For changes that affect page layout, such as displaying or hiding controls, use the Format event.

The Print event occurs only for sections that are actually printed. If you need access to data from sections that aren’t printed (for example, you are keeping a running sum, but are only printing certain pages), use the Format event instead.

The Page event occurs after all the Format events for the report, and after all the Print events for a page, but before the page is actually printed.

See Also

Format Event; FormatCount Property; NoData Event; Page Event; Page, Pages Properties; PrintCount Property; Retreat Event.