Add a field or group
The fields and groups that you add to the data source define the type and structure of the data that users can enter into your form. If you want to match the properties of an existing field or group to a new field or group, you can also add a reference field or reference group to your form.
Note If the form you are designing is based on a sample form, pre-existing XML Schema, database, or Web service, you might not be able to add new fields or groups to some of the existing fields and groups. In addition, you can add fields and groups only to the main data source, not to secondary data sources.
- In design mode, if the Data Source task pane is not visible, click Data Source on the View menu.
- If your form uses more than one data source, click Main in the Data source list. You cannot add fields or groups to secondary data sources.
- In the Data Source task pane, right-click the field or group to which you want to add a field, and then click Add on the shortcut menu.
- In the Name box in the Add Field or Group dialog box, type a name for the new field.
Note Names cannot contain spaces. They must begin with an alphabetic character or underscore ("_"), and they can only contain alphanumeric characters, underscores, hyphens ("-"), and periods (".").
- In the Type
list, click either an element field (the standard type of field) or an attribute field.
Note If you are adding a field to an existing field, the type must be Field (attribute).
- In the Data type
list, click the data type of the field.
Note Attribute fields cannot have rich text (XHTML) data types.
- To specify that the field should contain an initial value when the form is first opened by a user, type the value in the Default value box.
- To make the field a repeating field, select the Repeating check box.
Note Attribute fields cannot repeat.
- To require that the field contain a value, select the Cannot be blank check box. If you select this check box, any control bound to the field that does not have a value entered into it will be marked with a red asterisk or, for some types of controls, a dashed red border.
- In design mode, if the Data Source task pane is not visible, click Data Source on the View menu.
- In the Data Source task pane, right-click the group to which you want to add a group, and then click Add on the shortcut menu.
- If your form uses more than one data source, click Main in the Data source list. You cannot add fields or groups to a secondary data source.
- In the Name box in the Add Field or Group dialog box, type a name for the new group.
Note Names cannot contain spaces. They must begin with an alphabetic character or underscore ("_"), and they can only contain alphanumeric characters, underscores, hyphens ("-"), and periods (".").
- In the Type
list, do one of the following:
- To add a standard group, click Group.
- To add a choice group, which can be bound to a choice group control, click Group (choice).
- To make the group a repeating group, select the Repeating check box.
When you reference an existing field, Microsoft Office InfoPath 2003 creates a new field whose properties are linked and matched to the properties of the original field, including the name and data type. Both fields become reference fields, and any changes you make to one field updates the other field automatically.
- In design mode, if the Data Source task pane is not visible, click Data Source on the View menu.
- If your form uses more than one data source, click Main in the Data source list. You cannot reference fields or groups in a secondary data source.
- Right-click the field on which you want to base the reference field, and then click Reference on the shortcut menu.
- In the Reference Field or Group dialog box, click the group that you want to contain the new reference field.
Note Two reference fields cannot be part of the same group.
When you reference an existing group, InfoPath creates a new group whose properties and fields are linked and matched to the properties and fields of the original group. Both groups become reference groups, and any changes you make to one group, including changes to the fields in that group, updates the other group automatically.
- In design mode, if the Data Source task pane is not visible, click Data Source on the View menu.
- If your form uses more than one data source, click Main in the Data source list. You cannot reference fields or groups in a secondary data source.
- Right-click the group on which you want to base the reference group, and then click Reference on the shortcut menu.
- In the Reference Field or Group dialog box, click the group that you want to contain the new reference group.
Note Two reference groups cannot be part of the same group.
Note The information in this topic may not apply if you are working with a form designed using Microsoft Office InfoPath 2003 without the service pack installed. Learn more