Create a command button without a wizard

Create a command button without a wizard

  1. Open a form in Design view or a data access page in Design view.

  2. Click the Control Wizards tool in the toolbox if it's pressed in. This turns off the wizard.

  3. In the toolbox, click the Command Button tool Command Button control.

  4. On the form or data access page, click where you want to place the command button.

  5. Make sure that the command button is selected, and then click Properties on the toolbar to open the command button's property sheet.

  6. In the OnClick property box on a form, enter the name of the macro or event procedure that you want to run when the button is clicked, or click the Build button to use the Macro Builder or Code Builder. On a data access page, you can attach code written in either JScript or Microsoft Visual Basic Scripting Edition (VBScript) to a command button by using the Microsoft Script Editor. How to create an event procedure for a command button on a data access page.

  7. If you want to display text on the command button, type the text in the Caption property box of a form or the Value property of a data access page. If you don't want text on the button in a form, you can use a picture instead.

    How?

Tip   On a form, to create a command button that runs a macro; drag the macro from the Database window to form Design view.

For an overview of events and event procedures, click .