DoCmd.MoveSize Method (Access)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

The MoveSize method carries out the MoveSize action in Visual Basic.

expression .MoveSize(Right, Down, Width, Height)

expression A variable that represents a DoCmd object.

Parameters

Name

Required/Optional

Data Type

Description

Right

Optional

Variant

The new horizontal position of the window's upper-left corner, measured from the left edge of its containing window.

Down

Optional

Variant

The new vertical position of the window's upper-left corner, measured from the top edge of its containing window.

Width

Optional

Variant

The window's new width.

Height

Optional

Variant

The window's new height.

You can use the MoveSize method to move or resize the active window.

The units for the arguments are twips.

You must include at least one argument for the MoveSize method. If you leave an argument blank, the current setting for the window is used.

The following example moves the active window and changes its height, but leaves its width unchanged:

DoCmd.MoveSize 1440, 2400, , 2000

Concepts

Other resources

Show: