Format Event -- Macros

Description

To run a macro when the Format event occurs, set the OnFormat property to the name of the macro.

Remarks

You can use the FormatCount property to check whether the Format event has occurred more than once for a section. For example, if a section doesn’t fit on one page and part of it moves to the next page of the report, the Format event occurs once for each page, and the FormatCount property is set to 2. You can check the FormatCount property setting to determine how many times a Format macro is run per section.

You can use the CancelEvent action in a Format macro to cancel formatting of a section. Microsoft Access doesn’t format the section for printing and prints the next section instead. You can use CancelEvent to skip a section in a report without leaving a blank space on the page when the report is printed.

See Also

Format Event — Event Procedures.