< Day Day Up > |
Reports have events too, although the sequence is somewhat less rich than the event sequence for forms, because reports do not allow the user to interact with the data that they display. When you open a report, Access fires a mere two events in this sequence:
As is the case with forms, these events represent the first point where the report is open enough to run code, and the point where it gains the focus onscreen. When you close a report, you see two corresponding events:
Of course, there's more going on with reports than just opening and closing. In between, Access usually has data to display. For each report section, the event sequence includes up to four events:
The Format event occurs after Access determines which data belongs in a particular section of the report, but before the section is actually formatted. The Retreat event is fired only if Access decides it has to "back up" and reformat a previously formatted section. For example, if you have properties set to keep data together on a page, Access might need to revisit a section it's already formatted to honor those properties. The NoData event is fired whenever a bound section does not return any data. And the Print event occurs after the data is formatted, but before it's actually printed. Finally, Access fires the report's Page event once for each page in the report, just before that page gets printed. |
< Day Day Up > |