DblClick Event

Applies To

Bound Object Frame Control, Chart Control, Check Box Control, Combo Box Control, Command Button Control, Form, Form Section, Image Control, Label Control, List Box Control, Option Button Control, Option Group Control, Rectangle Control, Subform/Subreport Control, Text Box Control, Toggle Button Control, Unbound Object Frame Control.

Description

The DblClick event occurs when the user presses and releases the left mouse button twice over an object.

On a form, the DblClick event occurs when the user double-clicks a disabled control or a blank area of the form. For a control, it occurs when the user double-clicks a control or its label in Form view. The DblClick event occurs when the user double-clicks the form or control but before the result of the double-click action occurs (for example, before Microsoft Access selects the word that the insertion point is on in a text box).

Notes

  • The DblClick event applies only to forms, form sections, and controls on a form.
  • This event doesn’t apply to check boxes, option buttons, or toggle buttons in an option group. It applies only to the option group itself.
  • This event doesn’t apply to a label attached to another control, such as the label for a text box. It applies only to “freestanding” labels. Double-clicking an attached label has the same effect as double-clicking the associated control. The normal events for the control occur, not any events for the attached label.

Remarks

For controls, the result of double-clicking depends on the control. For example, double-clicking a word in a text box selects the entire word. Double-clicking a control containing an OLE object starts the application used to create the object, allowing it to be edited.

If the DblClick event doesn’t occur within the double-click time limit of the system, the form, form section, or control recognizes two Click events instead of a single DblClick event. The double-click time limit depends on the Double-click speed setting in the Mouse section of the Microsoft Windows Control Panel.

By running a macro or an event procedure when the DblClick event occurs, you can open a window or document when an icon is double-clicked.

Double-clicking a control causes both Click and DblClick events to occur. If the control doesn’t already have the focus when you double-click it, the Enter and GotFocus events for the control occur before the Click and DblClick events.

For objects that receive mouse events, the events occur in this order:

MouseDown MouseUp Click DblClick.

When you double-click a command button, the following events occur in this order:

MouseDown MouseUp Click DblClick MouseUp Click

The second click may have no effect (for example, if the Click macro opens a modal dialog box in response to the first Click event). To prevent the second Click macro or event procedure from running, put a CancelEvent action in the DblClick macro or use the Cancel argument in the DblClick event procedure.

If you double-click any other control besides a command button, the second Click event doesn’t occur.

See Also

Click Event; MouseDown, MouseUp Events.