Ms Access 简明教程
MS Access - One-To-Many Relationship
您的大多数关系很可能都是一对多的关系,其中一个表中的一个记录有可能与另一个表中的许多记录相关联。
The vast majority of your relationships will more than likely be this one to many relationships where one record from a table has the potential to be related to many records in another table.
创建多对一关系的过程与创建一对一关系的过程完全相同。
The process to create one-to-many relationship is exactly the same as for creating a one-to-one relationship.
我们首先通过单击 Clear Layout 中的 Design tab 选项来清除布局。
Let us first clear the layout by clicking on the Clear Layout option on the Design tab.
我们首先将添加另一个表 tblTasks ,如下面的屏幕截图所示。
We will first add another table tblTasks as shown in the following screenshot.
单击 Save 图标,输入 tblTasks 作为表名,然后转到 Relationship 视图。
Click on the Save icon and enter tblTasks as the table name and go to the Relationship view.
单击 Show Table 选项。
Click on the Show Table option.
添加 tblProjects 和 tblTasks 并关闭 Show Table 对话框。
Add tblProjects and tblTasks and close the Show Table dialog box.
我们可以再次运行相同的过程以关联这些表。单击并按住 tblProjects 中的 ProjectID,然后将其一直拖到 tblTasks 中的 ProjectID。此外,当您松开鼠标时,将弹出一个关系窗口。
We can run through the same process once again to relate these tables. Click and hold ProjectID from tblProjects and drag that all the way over to the ProjectID from tblTasks. Further, a relationships window pops up when you release the mouse.
单击创建按钮。我们现在已经创建了一个非常简单的关系。
Click the Create button. We now have a very simple relationship created.