Change the default master/detail relationship

Microsoft Office InfoPath 2003

Show All Show All

Change the default master/detail relationship

When you insert a master/detail control onto your form by using the Controls task pane, Microsoft Office InfoPath 2003 establishes a one-to-one relationship between the master control and the detail control. This means that for each selection in the master control, a single matching result appears in the detail control. You can change the master/detail relationship from the default one-to-one relationship to a one-to-many relationship. In other words, for each selection in the master control, multiple matching results can appear in the detail control.

When you insert a master/detail control, InfoPath inserts a repeating table and a repeating section by default. Both of these controls are bound to the same repeating group in the data source. By default, both controls contain other controls, which are bound to fields in that repeating group. In a one-to-many relationship, however, master and detail controls are typically bound to separate repeating groups. If you've inserted a master/detail control from the Controls task pane, and you want to establish a one-to-many relationship instead of a one-to-one relationship, you can delete the detail control that InfoPath creates and then create a new one that better suits your needs, as outlined in the following procedure.

ShowTip

  1. In design mode, select the repeating section that is designated as the detail control, and then press DELETE.
  2. Insert a new repeating section onto the form.

    ShowHow?

  3. Insert the controls you want into the repeating section.

    ShowHow?

  4. Right-click the repeating section, and then click Repeating Section Properties on the shortcut menu.
  5. In the Repeating Section Properties dialog box, click the Master/Detail tab.
  6. Under Master/detail settings, click Set as detail.
  7. In the Link to master ID list, click the name of the master control.
  8. Under Master/detail relationship, click By key field.
  9. Click Select XPath Button image next to the Key field (master) box, and then, in the Select a Field or Group dialog box, click the key field for the master control, and then click OK.
  10. Click Select XPath Button image next to the Key field (detail) box, and then, in the Select a Field or Group dialog box, click the key field for the detail control, and then click OK.

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