Microsoft Office Online
Sign in to My Office Online (What's this?) | Sign in

 
 
Microsoft Office InfoPath
Search
Search
 
Check for updates: (c) Microsoft
Office downloads
 
 
 
Warning: You are viewing this page with an unsupported Web browser. This Web site works best with Microsoft Internet Explorer 6.0 or later, Firefox 1.5, or Netscape Navigator 8.0 or later. Learn more about supported browsers.

Email this linkEmail this link Printer-Friendly VersionPrinter-Friendly Version Bookmark and ShareShare
About master/detail controls
 

If you expect users to work with large amounts of data on your form—for example, with multiple records in a database—you can use a master/detail control to make it easier for them to manage that data. When a user selects an item in a master control, related information about that item appears in a detail control.

For example, you can use a master/detail control when designing a human resources form that is connected to a database of employee records. The master control can display employee name and job title, and the details control can display employee location, hire date, date of birth, and so on. In database terms, this is the equivalent of a one-to-one relationship.

Similarly, you can use the master control to display one set of records (for example, customer names) and the details control to display related records (for example, customer orders). In database terms, this is the equivalent of a one-to-many relationship.

The master/detail relationship

A master/detail control is actually a set of two related controls. One of these controls is the designated master control; the other is the designated detail control. The master control is always a repeating table (repeating table: A control on a form that contains other controls in a table format and that repeats as needed. Users can insert multiple rows when filling out the form.). The detail control can be either a repeating table or a repeating section (repeating section: A control on a form that contains other controls and that repeats as needed. Users can insert multiple sections when filling out the form.). You can create the master/detail relationship by inserting the appropriate repeating controls on your form and then changing the properties of each control. Or, you can insert a predefined master/detail control from the Insert controls list in the Controls task pane.

When you insert a master/detail control from 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 each selected row in the master control has only a single matching result in the detail control. In a typical one-to-one relationship, both master and detail controls are 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 same repeating group (repeating group: A group in the data source that can occur more than once. Controls such as repeating sections and repeating tables are bound to repeating groups.) in 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.).

If you prefer, you can use key fields (key field: A field in the data source that links related data in master and detail controls.) to establish a one-to-many relationship for a master/detail control. In this type of relationship, each selection in the master control can result in multiple matches in the detail control. For example, if users select a supplier record in a master control, they can view the products that are associated with that supplier in the detail control. In a typical one-to-many relationship, master and detail controls are bound to separate repeating groups in the data source

To establish a one-to-many relationship, you must use options on the Master/Detail tab to specify the appropriate key fields.

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.

advertisement