Master/Detail Many-To-One forms

You might have a lot of information about a particular class of entities, such as customers, employees, or parts. You might want to be able to scroll easily through a list of the entities (the many), then see the details for one of them. You do that in a master/detail many-to-one form.

Typically, you select one or two columns for the master table (enough for you to identify the entity, such as customer or employee) and the rest of the columns pertaining to the entity for the detail table.

NoteSelecting columns for the master and detail areas In a master/detail many-to-one form, you usually pick one or two columns for the master area and many columns for the detail area, and you change data or insert new data in the detail area only. The data in the master area is usually updated with a different form. To be able to insert new rows in the master area or detail area, you must include all columns that have been defined in the database as requiring values.

For information about defining data so that a form can update a database, see “Defining data so that a form can update a database”.

For example, the following form lists all customers at the top (the master area) and the details for the selected customer at the bottom (the detail area):

The sample shows a master / detail  many to one form labeled Customer Details. The left top section displays a scrollable grid with columns for company name and Customer I D. Below it is a scrollable grid that displays six rows of data for the selected company in columns labeled Customer, Address, City, State, Zip Code, Phone Number, and Contact.

Both the master and detail areas use the Customer table in the EAS Demo DB. The Company_name and Id columns were chosen for the master table, and all columns were chosen for the detail table.

NoteAbout the Id column Since the Id column is the primary key, you must select the Id column to make the detail part for the form updatable, but you can delete it from the detail part.