Microsoft Access can create your command button for you if you use a wizard. However, wizards are not available in a stand-alone data access page, or when you point a data access page to a database other than the one that is currently open. The Command Button Wizard is also not available if the data access page isn't bound to a table or query. You will have to create a command button on your own if wizards aren't available.
Create or modify a command button with a wizard
Create or modify a command button without a wizard
To display text on a command button on a data access page: Type the text in command button's Value property box.
To display text on a command button on a form: Type the text in the command button's Caption property box.
To display a picture on a command button on a form: In the command
button's Picture property box, type the path and file name for a
.bmp, .ico, or .dib file. If you're not sure of the path or file name, click
the Build button
to open
the Picture Builder.
Tip
On a form, to Create or modify a command button that runs a macro, drag the macro from the Database window to form Design view.
Create a Cancel button
When a command button's Cancel property is set to Yes and the form is the active form, you can choose the command button by clicking it, pressing the ESC key, or pressing ENTER when the command button has the focus. When the Cancel property is set to Yes for one command button, it's automatically set to No for all other command buttons on the form. Only one button can be the default on a form.
To have a Cancel button cancel all the actions that have taken place in a form or dialog box, you need to write a macro or event procedure and attach it to the OnClick property of the button.
Tip
For a form that allows irreversible operations, such as deletions, it's a good idea to make the Cancel button the default command button. To do this, set both the Cancel property and the Default property to Yes.
See an event procedure created by the Command Button Wizard
The following procedure describes how to display an event procedure created by the Command Button Wizard on a form. In a data access page, you have to create the event procedure yourself.