About controls

Microsoft Office InfoPath

Show All Show All

About controls

When filling out forms, users enter information by typing in text boxes, choosing items in a list, selecting check boxes, and so forth. The objects users interact with are called controls. A control is a graphical object, such as a text box, check box, or button, that appears on a form. Information entered into a control is stored in the form’s data source. When you design a form, you use the Controls task pane to insert controls.

Controls task pane in InfoPath

You can customize a control’s appearance, including font, color, and alignment, its default value and data type, and other properties, such as the ScreenTip that appears when a user rests the mouse pointer on the control and a keyboard shortcut to manipulate the control without a mouse. To view the properties for a control, double-click the control on the form.

Controls and the data source

Almost all controls on an InfoPath form are associated with, or bound to, the data source. Most controls, including text boxes, check boxes, and list boxes, are bound to fields. A field is where the information entered into the control is saved. If a control is not bound, or if it is bound incorrectly, the information entered into the control cannot be saved. When you design forms in Microsoft Office InfoPath 2003, you can choose to have the fields in the data source created automatically each time you insert a control, or you can bind controls to existing fields.

The following example illustrates the relationship between two drop-down list boxes and the fields that store their data.

How controls are connected to data source

Together, a control and its field determine the type of information users can enter, as well as how they enter it. For example, a date picker control makes it easy for users to enter dates, and the field to which the date picker is bound saves only values that are dates (in other words, the field has a date data type).

Inserting controls in your form

When designing a form, you can use the Controls task pane to insert controls. You can choose to create the data source automatically when you insert a control, in which case a field or group will be automatically created for each control you add, or to bind the control to an existing field or group. If you choose to bind to an existing field or group, you are prompted to select a field or group from the data source when you insert the control. To switch between automatically creating the data source and binding controls to an existing field or group, use the Automatically create the data source check box in the Controls task pane.

You can also insert controls by dragging fields and groups from the Data Source task pane onto the form. Each time you drag a field or group, InfoPath suggests the control that best matches the field or group. If the field has a date data type, for example, InfoPath suggests a date picker.

Types of controls

ShowStandard controls

ShowRepeating and optional controls

ShowHyperlink and picture controls

ShowButtons and expression boxes

Testing controls

To test controls, you can preview the form and enter information into the controls, add and remove rows and sections from repeating controls, and add and delete optional sections. In addition, you can select any control to display an icon that indicates whether the control is correctly bound to its field. There are three possible icons:

Icon image The binding is correct.
Icon image The control may not function as expected because of a potential binding problem. To identify the potential problem, right-click the control, and then click More Details on the shortcut menu.
Icon image The control will not function correctly because of a binding problem. To identify the problem, right-click the control, and then click More Details on the shortcut menu.