Table of contents
TOC
Collapse the table of content
Expand the table of content

CommandButton Object (Access)

office 365 dev account|Last Updated: 1/25/2018
|
2 Contributors

This object corresponds to a command button. A command button on a form can start an action or a set of actions. For example, you could create a command button that opens another form. To make a command button do something, you write a macro or event procedure and attach it to the button's OnClick property.

Remarks

Control:Tool:
Command buttonCommand button

You can display text on a command button by setting its Caption property, or you can display a picture by setting its Picture property.

Note You can create over 30 different types of command buttons with the Command Button Wizard. When you use the Command Button Wizard, Microsoft Access creates the button and the event procedure for you.

Events

Name
Click
DblClick
Enter
Exit
GotFocus
KeyDown
KeyPress
KeyUp
LostFocus
MouseDown
MouseMove
MouseUp

Methods

Name
Move
Requery
SetFocus
SizeToFit

Properties

Name
AddColon
Alignment
Application
AutoLabel
AutoRepeat
BackColor
BackShade
BackStyle
BackThemeColorIndex
BackTint
Bevel
BorderColor
BorderShade
BorderStyle
BorderThemeColorIndex
BorderTint
BorderWidth
BottomPadding
Cancel
Caption
Controls
ControlTipText
ControlType
CursorOnHover
Default
DisplayWhen
Enabled
EventProcPrefix
FontBold
FontItalic
FontName
FontSize
FontUnderline
FontWeight
ForeColor
ForeShade
ForeThemeColorIndex
ForeTint
Glow
Gradient
GridlineColor
GridlineShade
GridlineStyleBottom
GridlineStyleLeft
GridlineStyleRight
GridlineStyleTop
GridlineThemeColorIndex
GridlineTint
GridlineWidthBottom
GridlineWidthLeft
GridlineWidthRight
GridlineWidthTop
Height
HelpContextId
HorizontalAnchor
HoverColor
HoverForeColor
HoverForeShade
HoverForeThemeColorIndex
HoverForeTint
HoverShade
HoverThemeColorIndex
HoverTint
Hyperlink
HyperlinkAddress
HyperlinkSubAddress
InSelection
IsVisible
LabelAlign
LabelX
LabelY
Layout
LayoutID
Left
LeftPadding
Name
ObjectPalette
OldValue
OnClick
OnDblClick
OnEnter
OnExit
OnGotFocus
OnKeyDown
OnKeyPress
OnKeyUp
OnLostFocus
OnMouseDown
OnMouseMove
OnMouseUp
OnPush
Parent
Picture
PictureCaptionArrangement
PictureData
PictureType
PressedColor
PressedForeColor
PressedForeShade
PressedForeThemeColorIndex
PressedForeTint
PressedShade
PressedThemeColorIndex
PressedTint
Properties
QuickStyle
QuickStyleMask
ReadingOrder
RightPadding
Section
Shadow
Shape
ShortcutMenuBar
SoftEdges
StatusBarText
TabIndex
TabStop
Tag
ThemeFontIndex
Top
TopPadding
Transparent
UseTheme
VerticalAnchor
Visible
Width

See also

Other resources

Access Object Model Reference
CommandButton Object Members

© 2018 Microsoft