Default Events

Many types of objects in Microsoft Access are most often associated with a particular event. For example, command buttons are most commonly associated with the Click event.

To make it easier for you to program responses to these default events, the shortcut menu includes the Build Event command. When you right-click on an object, and then click Build Event, Microsoft Access displays the Choose Builder dialog box. If you click Macro Builder, Microsoft Access sets the object’s default event property to the name of the macro you create. If you click Code Builder, Microsoft Access opens the Module window and displays the object’s default event procedure.

Note   No event occurs for an object by default. The default event is only the event procedure that Microsoft Access displays when you click Build Event on the shortcut menu. Microsoft Access always runs the procedure associated with an object and the event that actually occurs, regardless of the object’s default event.

The following table shows the default events for Microsoft Access objects that have them.

Object Default event
Form Load
Report Open
Bound object frame Updated
Unbound object frame Updated
Image control Click
Chart Updated
Check box (not in option group) Click
Check box (in option group) GotFocus
Command button Click
Label Click
List box BeforeUpdate
Option button (not in option group) Click
Option button (in option group) GotFocus
Rectangle Click
Option group BeforeUpdate
Toggle button (not in option group) Click
Toggle button (in option group) GotFocus
Subform/subreport Enter
Text box BeforeUpdate
Combo box BeforeUpdate
Tab control Click
Page Click
Section (Report) Format
Section (Form) Click