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 group or field, you can also add a reference field or reference group.
Note If your form template is based on a sample form, pre-existing XML Schema, database, or Web service, you might not be able to add to some of the existing fields and groups.
- 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 or field to which you want to add a field, and then click Add on the shortcut menu.
- In the Add Field or Group dialog box, type the name of the new field in the Name box.
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 box, select either an element field (the standard type of field) or an attribute field.
Note If you are adding to a field, the type must be Field (attribute).
- In the Data Type box, select the data type of the field.
Note Attribute fields cannot have rich text (XHTML) data types.
- If you want the field to contain an initial value when the form is first opened by a user, type the value in the Default Value box.
- Select the Repeating check box if you want the field to be a repeating field.
Note Attribute fields cannot repeat.
- Select the Cannot be blank check box if you want to require that the field contain a value. 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 an error alert.
- 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.
- In the Add Field or Group dialog box, type the name of the new group in the Name box.
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 box, select Group.
- Select the Repeating check box if you want the group to be a repeating group.
When you reference a 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 a change 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.
- In the Data Source task pane, 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, select a group to contain the new reference field.
Note Two reference fields cannot be part of the same group.
When you reference a group, Microsoft Office InfoPath 2003 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 a change 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.
- In the Data Source task pane, 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, select a group to contain the new reference group.
Note Two reference groups cannot be part of the same group.