Ways to customize a button

After you insert a button on a form template, you can customize it by changing properties and settings in the Button Properties dialog box. To open the dialog box, on the form template, double-click the button whose properties you want to change.

The following table describes some of the ways in which you can customize a button and offers reasons why you might do so. Although the table doesn't provide detailed procedural information about the options in the Button Properties dialog box, it does give you an idea of the range of options that are available.





Assign an action to the button

In the Action list, define what you want to have happen when the user clicks the button. If you want the button to submit data to a single data source, click Submit. If you want rules or custom code to run when the button is clicked, click Rules and Custom Code.

Available actions

The Submit and Rules and Custom Code actions are always available. The availability of other button actions depends on how the form template was designed and whether the form template includes a data connection that queries or submits data to external data sources, such as a database or Web service.




This action initiates the standard submit functionality for the form — this is the same as the user clicking Submit on the File menu. To initiate a custom submit action, select Rules and Custom Code, and then create a rule for submitting the data.

Rules and Custom Code

This action either runs a rule when the button is clicked or runs custom code. For example, you can create a rule that automatically submits the data from a form to a Web service or submits the data as an e-mail message, in response to the user clicking the button. To define a rule, click Rules. To define code, click Edit Form Code.

Run Query

If the form is connected to a database or Web service, this action queries a database or Web service based on the values entered in the fields that are used to query the data.

New Record

If the form is connected to a database or Web service, this action clears the values on the form so that a user can enter new data.

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.


If the form is connected to a database or Web service, this action refreshes the data from the database or Web service that has been returned in a query.

Update Form

In a form that is designed to be filled out in a Web browser, this action updates form data in an incremental manner. For example, imagine a Total box that changes based on the values that users enter in other controls on the form. To avoid refreshing the form whenever the values in those controls change, you can prevent data from being sent to the server for those specific controls. You can then add an Update Totals button next to the Total box, which the user can click to manually refresh the totals. The button associated with the Update Form action is visible only when users display and fill out the form in the browser.


Change the button label

In the Label box, type the text that you want to display on the face of the button. If you want the text on the button to change depending on values on the form, click Insert Formula Button image , and then select the field that stores the value that you want to use. For example, you can create a button with the label Send To Manager, where Manager is the name that a user types in a Manager text box elsewhere on the form.


Obtain the button identifier

You can use the ID listed on this tab to identify the button in code. You can also change the default name of the button ID so that it is easier for you to remember.


Write custom code

Click Edit Form Code to open Microsoft Visual Studio 2005 Tools for Applications (VSTA), where you can write custom code to automate the button's behavior.


Assign rules to automate the button's behavior

Click Rules to open the Rules dialog box, where you can create rules that run when the button is clicked. For example, you can set up a rule that opens a new form or switches views when users click the button.


Add conditional formatting

Click Conditional Formatting to open the Conditional Formatting dialog box, where you can change the appearance of a control, including its visibility, based on values that users enter into the form. For example, you can choose to hide one or more buttons unless a specific check box is selected by the user.


Adjust size, padding, and margins

You can manually specify the size of a control by entering values in the Height and Width boxes. You can also refine the spacing both inside and outside the control by changing the padding, which is the amount of buffer space surrounding the control's contents, or the margins, which is the amount of space between the control's border and any surrounding text or controls on the form template.


Specify a ScreenTip

To make an explanatory note appear when users move their pointer over the control, enter the text that you want in the ScreenTip box. Accessibility aids, such as screen review utilities that make on-screen information available as synthesized speech or a refreshable Braille display, often rely on these ScreenTips to interpret information for their users.


Change the tab index order

You can change the position of a control in the form template's overall tab order. Tab order is the order in which the focus moves in a form from one field or object to the next as users press TAB or SHIFT+TAB. The default tab index setting for all controls in a form template is 0, but the tab order starts with 1. That is, any control with 1 in the Tab index box will be visited first when users press the TAB key. Any control with 2 in the Tab index box will be visited second, and so on. Any controls with 0 in the Tab index box will come last in the tab order. If you want to skip controls in the tab order, enter -1 in the Tab index box.


Assign a keyboard shortcut

You can type a letter or number in the Access key box to specify a keyboard shortcut. Keyboard shortcuts enable users to navigate to a control by pressing a combination of keystrokes, rather than by moving the mouse. If you choose to use keyboard shortcuts in your form template, you must communicate to users that the shortcuts exist. For example, you might type (ALT+S) after a text box label to let users know that there's a keyboard shortcut for a Salesperson text box.

Browser forms

Customize settings for posting data back to the server

The Browser forms tab appears only when you are designing a browser-compatible form template. It allows you to control whether data is sent to the server when users click the button on the form.

Expand your Office skills
Explore training
Get new features first
Join Office Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.