Access tutorial 8.4 "relationship" and "sub-table"

Source: Internet
Author: User
Open the "customer information table" and you will find that some new tables are added to this table. They are subtables of the "customer information table", that is, the "Order Information table ". In this case of "one-to-many", you can use the "Company Name" information in the "Customer Info table" to concatenate the contents of both tables. Each record in the master table carries

Open the "customer information table" and you will find that some new tables are added to this table. They are subtables of the "customer information table", that is, the "Order Information table ". In this case of "one-to-many", you can use the "Company Name" information in the "Customer Info table" to concatenate the contents of both tables. Each record in the master table carries


Open the "customer information table" and you will find that some new tables are added to this table. They are subtables of the "customer information table", that is, the "Order Information table ".

In this case of "one-to-many", you can use the "Company Name" information in the "Customer Info table" to concatenate the contents of both tables. Each record in the master table carries an "order" record in one or more sub-tables. Two tables with a "one-to-one" relationship are "sub-tables" of each other ".

After the relationship between tables is established, Access will automatically insert sub-tables in the master table. However, these subtables are not displayed at the beginning. In Access, the sub-table is displayed as "Expand", and the sub-Table hiding is called "collapse ". You can easily view the order information when you expand it. After you fold it, you can easily manage the "customer information table ".

To "Expand" the child data table, you only need to click the first field in the master table in front of a grid, and the Child record of the corresponding record will "Expand, in addition, the "plus sign" in the small box is changed to "minus sign ". If you click it again, you can fold the sub-record of the grid, and the minus sign in the small box is also changed back to the plus sign ". If the primary table is large, it is too difficult to "Expand" and "collapse" the child Data Tables one by one. Access provides us with an operation method, it can "Expand" or "collapse" all child data tables of the current data table. When you open a table with a sub-data table, in the "format" menu "sub-menu of" sub-data table, there are three commands: "Expand All", "collapse all", and "delete". The "Expand All" command can "Expand" all the child data tables in the master table ", the "hide all" command is used to fold all child data tables in the master table. When you do not need to display a sub-data table in the master table to reflect the "relationship" between the two tables, you can use the "delete" command to delete the sub-data table display method. However, the relationship between the two tables is not deleted. If you want to restore the display of the "sub-data table" on the master table, you can first open the master table, for example, "customer information table", and click the "sub-data table" command under the "insert" menu, the "insert child data table" dialog box is displayed, as shown in:

Select "table"> "Order info table" from the list box, and then select the "Order unit" field in the "link subfield" combo box, select the company name field in the "link main field" combo box, click "OK" to re-insert the "Order Information table" of the sub-data table in the "customer information table" of the master data table. Note that inserting a child data table in any data table requires a "relationship" between the two tables ", if there is no connection between the "primary link field" and "sublink field" of the two tables, when you click "OK" to insert a "sub-data table", you will be asked if you want to establish a "relationship" between the two tables. After the "relationship" is established, to complete the "insert a child data table" process. Establishing a "Link" between tables in this way is not as intuitive as creating a "link" in the "Link" dialog box. Therefore, we advocate creating a "relationship" between the table and the table in the relationship dialog box and using Access to automatically create a child data table.

Conclusion: This course presents the "relationship" between tables in the "customer information table" and "order information table". If you have mastered the table operations, let's take a look at the next lesson. If you haven't fully mastered the "table", take a look at the four lessons, because tables are the most important part of the database.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.