Report.Load event (Access)

Occurs when a report is opened and its records are displayed.

Syntax

expression.Load

expression A variable that represents a Report object.

Remarks

To run a macro or event procedure when these events occur, set the OnLoad property to the name of the macro or to [Event Procedure].

The Load event is caused by user actions such as:

  • Starting an application.
  • Opening a report by choosing Open in the Database window.
  • Running the OpenReport action in a macro.

By running a macro or an event procedure when a report's Load event occurs, you can specify default settings for controls, or display calculated data that depends on the data in the report's records.

By running a macro or an event procedure when a report's Unload event occurs, you can verify that the report should be unloaded or specify actions that should take place when the report is unloaded.

When you first open a report, the following events occur in this order:

OpenLoadResizeActivateCurrent

If you are trying to decide whether to use the Open or Load event for your macro or event procedure, one significant difference is that the Open event can be canceled, but the Load event cannot. For example, if you are dynamically building a record source for a report in an event procedure for the report's Open event, you can cancel opening the report if there are no records to display.

When you close a report, the following events occur in this order:

UnloadDeactivateClose

The Unload event occurs before the Close event. The Unload event can be canceled, but the Close event cannot.

Note

When you create macros or event procedures for events related to the Load event, such as Activate and GotFocus, be sure that they don't conflict (for example, make sure that you don't cause something to happen in one macro or procedure that is canceled in another) and that they don't cause cascading events.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.