Share via


Report.MouseMove Event (Access)

The MouseMove event occurs when the user moves the mouse.

Syntax

expression .MouseMove(Button, Shift, X, Y)

expression A variable that represents a Report object.

Parameters

Name

Required/Optional

Data Type

Description

Button

Required

Integer

The button that was pressed or released when the event was triggered. If you need to test for the Button argument, you can use one of the following intrinsic constants as bit masks:

  • acLeftButton The bit mask for the left mouse button.

  • acRightButton The bit mask for the right mouse button.

  • acMiddleButton The bit mask for the middle mouse button.

Shift

Required

Integer

The state of the SHIFT, CTRL, and ALT keys when the button specified by the Button argument was pressed or released. If you need to test for the Shift argument, you can use one of the following intrinsic constants as bit masks:

  • acShiftMask The bit mask for the SHIFT key.

  • acCtrlMask The bit mask for the CTRL key.

  • acAltMask The bit mask for the ALT key.

X

Required

Single

The x coordinate for the current location of the mouse pointer, in twips.

Y

Required

Single

The y coordinate for the current location of the mouse pointer, in twips.

Return Value

nothing

Remarks

This event does not apply to a label attached to another control, such as the label for a text box. It applies only to "freestanding" labels. Pressing and releasing a mouse button in an attached label has the same effect as pressing and releasing the button in the associated control. The normal events for the control occur; no separate events occur for the attached label.

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

The MouseMove event is generated continually as the mouse pointer moves over objects. Unless another object generates a mouse event, an object recognizes a MouseMove event whenever the mouse pointer is positioned within its borders.

To cause a MouseMove event for a report to occur, press the mouse button in a blank area on the report. To cause a MouseMove event for a report section to occur, press the mouse button in a blank area of the report section.

Note

  • Moving a report can trigger a MouseMove event even if the mouse is stationary. MouseMove events are generated when the form moves underneath the pointer. If a macro or event procedure moves a report in response to a MouseMove event, the event can cascade (that is, continually generate MouseMove events).

  • If two controls are very close together, and you move the mouse pointer quickly over the space between them, the MouseMove event may not occur for the space (for example, this might be the MouseMove event for the report section). In such cases, you may need to respond to the MouseMove event in the contiguous control, as well as in the report section.

To run a macro or event procedure in response to pressing and releasing the mouse buttons, you use the MouseDown and MouseUp events.

See Also

Concepts

Report Object Members

Report Object