Add a field or group

The fields (field: An element or attribute in the data source that can contain data. If the field is an element, it can contain attribute fields. Fields store the data that is entered into controls.) and groups (group: An element in the data source that can contain fields and other groups. Controls that contain other controls, such as repeating tables and sections, are bound to groups.) that you add to the data source (data source: The collection of fields and groups that define and store the data for an InfoPath form. Controls in the form are bound to the fields and groups in 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 (reference field: A field that is associated with another field so that their properties always match. If the properties in one field are changed, the properties in the other field are updated automatically.) or reference group (reference group: A group that is associated with another group so that their properties and the properties of the groups and fields they contain always match. If the properties of one group are changed, the other group is updated automatically.) to your form.

 Note   If the form you are designing is based on a sample form, pre-existing XML Schema (XML Schema: A formal specification, written in XML, that defines the structure of an XML document, including element names and rich data types, which elements can appear in combination, and which attributes are available for each element.), 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.

ShowAdd a field

  1. In design mode, if the Data Source task pane is not visible, click Data Source on the View menu.
  2. 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.
  3. 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.
  4. 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 (".").

  1. In the Type list, click either an element field (the standard type of field) or an attribute field (attribute field: A field in the data source that can contain data and that is an attribute (instead of an element). Attribute fields cannot contain other fields.).

 Note   If you are adding a field to an existing field, the type must be Field (attribute).

  1. In the Data type list, click the data type of the field.

 Note   Attribute fields cannot have rich text (XHTML) data types.

  1. 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.
  2. To make the field a repeating field, select the Repeating check box.

 Note   Attribute fields cannot repeat.

  1. To require that the field contain a value, select the Cannot be blank check box. If you select this check box, any control bound (bind: To connect a control to a field or group in the data source so that data entered into the control is saved. When a control is unbound, it is not connected to a field or group, and so data entered into the control will not be saved.) 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.

ShowAdd a group

  1. In design mode, if the Data Source task pane is not visible, click Data Source on the View menu.
  2. 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.
  3. 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.
  4. 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 (".").

  1. In the Type list, do one of the following:
  2. To make the group a repeating group, select the Repeating check box.

ShowAdd a reference field

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 (data type: Property of a field that defines the kinds of data the field can store. Examples of data types include Text, Rich Text, Whole Number, Decimal, True/False, Hyperlink, Date and Time, and Picture.). Both fields become reference fields, and any changes you make to one field updates the other field automatically.

  1. In design mode, if the Data Source task pane is not visible, click Data Source on the View menu.
  2. 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.
  3. Right-click the field on which you want to base the reference field, and then click Reference on the shortcut menu.
  4. 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.

ShowAdd a reference 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.

  1. In design mode, if the Data Source task pane is not visible, click Data Source on the View menu.
  2. 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.
  3. Right-click the group on which you want to base the reference group, and then click Reference on the shortcut menu.
  4. 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.

 
 
Applies to:
InfoPath 2003