Insert a button
You can create a button on your form to make it easy for users to perform common tasks, such as submitting the form. You can also associate a button with script that runs when a user clicks the button.
- In design mode, place the insertion point where you want to insert the button.
- If the Controls task pane is not visible, click More Controls on the Insert menu.
- In the Controls task pane, click Button.
- Double-click the button icon and, in the Button Properties dialog box, click the action you want the button to perform in the Action
list.
The available button actions depend on the form. If the form is connected to a database or Web service, the button actions include Run Query, Submit, New Record, Delete & Submit, and Script. If the form is not connected to a database or Web service, the available actions are Submit and Script.
- Submit Submits the form to a database or Web service, or submits using custom script or through HTTP. When you select this action, you can specify the submit options you want.
- Script Runs a custom script action. To write or revise the script, click Microsoft Script Editor.
- Run Query If the form is connected to a database or Web service, this action queries the database or Web service based on the values of the query fields in the form.
- New Record If the form is connected to a database or Web service, this action switches to the data entry view and clears the values so a user can enter a new record.
- Delete & Submit If the form is connected to a database or Web service, this action deletes the records from the database that have been returned in a query.
- In the Label box, type the text that you want to appear on the button.
- If you chose the Script action and you want to write script to associate with the button, click Microsoft Script Editor. In Microsoft Script Editor, type the script that you want to run when the button is clicked.