Relationships between tables in Access
In this article, go with TipsMake.com to learn more about how to establish a relationship. The nn relationship is the relation between two tables, a record of table A can have multiple records matching in table B and vice versa.
In this article, go with TipsMake.com to learn more about how to establish a relationship.The nn relationship is the relation between two tables, a record of table A can have multiple records matching in table B and vice versa.
To create such a relationship, define the third table, called a join table, with the primary key including foreign keys from both Table A and Table B to divide the nn relationship into two 1-n relationships. .
Continuing with the examples in the previous tutorial, we added a tblTacgia table and a link table tblTacgiaNoi. The Author table includes the schools TacgiaID, Ten, Ho, Diachi, Dienthoai, Email, Ngaysinh.
Often an author will work with many projects, as well as a project that can have many authors working together. As in the previous tutorials, the tblDuAn table also has an author field, so we will create a separate table that includes information about the author. So, we don't need this field in the Project table anymore.
Choose Tacgia school , press the delete button and you will see the following message.
Click Yes .
Now we will create a link board. This connector has two foreign keys as follows:
These foreign key fields will be primary keys from both tables tblTg and tblDuAn.
To create multiple keys in Access, select both of these fields, go to the Design tab , click Primary Key, the selected fields will become keys.
Save the table with the name tblTacgiaNoi.
Next, go to the Relationship in the Design tab to create a relationship by clicking Show Table.
Select the tblDuAn, tblTacgia and tblTacgiaNoi tables, click Add to add all three tables to the desktop and close the Show Table dialog box .
Using the mouse to click and hold the TacgiaID field in tblTacgia table , drag to the TacgiaID field you want to connect to the table tblTacgiaNoi. When you release the mouse, Access opens the Edit Relationships window . Note, the relationship that is creating Access will be considered a 1-n relationship. Click the Cascade Update box and click Create:
Result:
Next, drag the DuAnID field from the tblDuAn table to the DuAnID field of the tableTableGoogle, and check the Enforce Referential Integrity box and Cascade Update Related Fields .
And this is the relationship we want to establish:
Previous article: 1-n relationship between tables in Access
Next lesson: Wildcard representation operator in Access
- MS Access 2007 - Lesson 8: Establish relationships between tables
- 1-1 relationship between tables in ACCESS
- Edit tables in Access 2016
- MS Access 2003 - Lesson 6: Creating a table in Access
- 1-n relationship between tables in Access
- Steps to export Microsoft Access data to Word documents
- Create Table (Table) in Access 2016
- Introduction to tables, queries, forms, reports in Access
- MS Access 2003 - Lesson 15: Create an initial table
- MS Access 2003 - Lesson 39: Analyzing tables
- Work with data in Access 2016
- MS Access 2003 - Lesson 12: Working with a table
- Create data queries in Access 2016 from simple to complex
- How to Link Tables in Access