See Also Macros Event Procedures Applies To
The Click event occurs when the user presses and then releases a mouse button over an object.
Notes
Remarks
To run a macro or event procedure when this event occurs, set the OnClick property to the name of the macro or to [Event Procedure].
On a form, this event occurs when the user clicks a blank area or record selector on the form.
For a control, this event occurs when the user:
Typically, you attach a Click event procedure or macro to a command button to carry out commands and command-like actions. For the other applicable controls, use this event to trigger actions in response to one of the occurrences discussed earlier in this topic.
For a command button only, Microsoft Access runs the macro or event procedure specified by the OnClick property when the user chooses the command button by pressing the ENTER key or an access key. The macro or event procedure runs once. If you want the macro or event procedure to run repeatedly while the command button is pressed, set its AutoRepeat property to Yes. For other types of controls, you must click the control by using the mouse button to trigger the Click event.
The Click event for a command button occurs when you choose the command button. In addition, if the command button doesn't already have the focus when you choose it, the Enter and GotFocus events for the command button occur before the Click event.
Double-clicking a control causes both the DblClick and Click events to occur. For command buttons, double-clicking triggers the following events, in this order:
MouseDown Þ MouseUp Þ Click Þ DblClick Þ Click
You can use a CancelEvent action in a DblClick macro to cancel the second Click event. For more information, see the DblClick event topic.
The Click event for an option group occurs after you change the value of one of the controls in the option group by clicking the control. For example, if you click a toggle button, option button, or check box in an option group, the Click event for the option group occurs after the BeforeUpdate and AfterUpdate events for the option group.
Tip To distinguish between the left, right, and middle mouse buttons, use the MouseDown and MouseUp events.