Detail table |
This mode allows you to set the one-to-many ratio between several tables. Two tables can be linked with each other by a key. One of these linked tables is the main or controlling table, and another - auxiliary, detailed table. For example, there is a table of Settlement of Noginsk district (t_district), containing the list of settlements. Also it is required that the user, moving along this table, saw not only names of settlements (field d_Name), but also the list of the settlements included into chosen settlement (t_locality). In this case the table t_district is the main table, the table t_locality is auxiliary one, and a key defining their link are the fields id and district_ref of these tables accordingly. The tables t_district, t_locality should be indexed by these fields. To each record in the main table the key puts into conformity generally a set of records of the auxiliary table. Make active the Standard form bookmark of Base Administrator. Add the table t_district, by clicking the button Add - Main table. Next, click the button Add - Detail table, add a detailed table and set the parameters of links between tables. At the end of forming the links click ОК button.
Window of Forming the list of the main and detail tables:
After all links are set up, press Show button. You will see that depending on the marked record in the list of settlements, to you the list of populated localities of this settlement is displayed. Thus, the cursor slides along the master table (fields are highlighted by blue color), and the auxiliary table displays only those records (fields are highlighted by red color) in which key fields coincide with key fields of the main table.
Window of Viewing the main and detail tables:
The detail table can be in its turn as the managing table. Work with the detail table is carried out by using the menu that appears by right-clicking on the table. Items of this menu are: -Add detail table. It is used for a choice of the detailed table and specifying the link parameters. -Link by another field. It is used for change of link parameters. -Properties. -Close. It is used for closing the table and if for the closed table the detailed tables were opened they are closed too.
Work with the main table is carried out by using this menu, except that the Link by another field item will not be displayed. Besides, the Add detail table item is not available if a user views a separate table. |