Print Report Section Event

The Print event occurs after the data in a report section has been formatted but before the data is printed. The Print event occurs only for sections that are actually printed. To access data from sections that are not printed, use the Format event.

You can use the PrintCount argument to check whether the Print event has occurred more than once for a record. If part of a record is printed on one page and the rest is printed on the next page, the Print event will occur twice, and the PrintCount argument will be set to 2. You can use the Cancel argument to cancel the printing of a section.

Table 25-2: Effect of Print event on report sections

Report Section

Description of Event

Detail

The Print event occurs for each record in the Detail section just before Microsoft Access prints the data in the record.

Group Headers

The Print event occurs for each new group.

Group Footers

The Print event occurs for each new group.

The event procedure in Hands-On 25-10 demonstrates how to print a record range indicator in the report's footer. This indicator will display the range of records printed on each page. You can easily modify this example procedure to print the first and last customer ID on the page (see the discussion before Figure 25-5).

Event Programming in Forms and Reports

0 0

Post a comment