Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CommandButton.Width Property (Access)
Collapse the table of content
Expand the table of content

CommandButton.Width Property (Access)

Gets or sets the width of the specified object in twips. Read/write Integer.

expression .Width

expression A variable that represents a CommandButton object.

For report controls, you can set the Width property when you print or preview a report only by using a macro or an event procedure specified in a section's OnFormat event property setting.

You can't set this property for an object once the print process has started.

Microsoft Access automatically sets the Width property when you create or size a control or when you size a window in form Design View or report Design view.

The width of forms and reports is measured from the inside of their borders. The width of controls is measured from the center of their borders so controls with different border widths align correctly. The margins for forms and reports are set in the Page Setup dialog box, available by clicking Page Setup on the File menu.

The following code resizes a command button to a 1-inch by 1-inch square button (the default unit of measurement in Visual Basic is twips; 1440 twips equals one inch):

Me!cmdSizeButton.Height = 1440 ' 1440 twips = 1 inch. 
Me!cmdSizeButton.Width = 1440
© 2015 Microsoft