1-1 relationship between tables in ACCESS

1-1 relations are used to link a record from one table to one and only one record in another table.

1-1 relations are used to link a record from one table to one and only one record in another table.

One-to-one relationships are created when both connection fields are primary keys or have unique constraints.

For further clarification, continue with the database and the tables we created in the previous lesson. First, go to the Database Tools tab.

Picture 1 of 1-1 relationship between tables in ACCESS
New tblHR Data table is created

Click on Relationships option .

Picture 2 of 1-1 relationship between tables in ACCESS
The Show Table dialog box appears

Select the Members panel and tblHRData, click Add to add both tables to the working screen and then close the Show Table dialog box .

Picture 3 of 1-1 relationship between tables in ACCESS
Both tables tblNhanvien and tblHRData are added to the screen

To create a relationship between these two tables, use the mouse to click and hold the NhanvienID field in the tblNhanvien table , drag the connection to the field you want to connect to in table tblHRData. When you release the mouse, Access will open the following window:

Picture 4 of 1-1 relationship between tables in ACCESS
Drag the two NhanvienID fields of the two tables together to display the Edit Relationships dialog box

This window relates to the tblNhanvien 's NhanvienID and NhanvienID of tblHRData. Click on the Create button and now these two tables are connected, establishing a relationship with each other.

Picture 5 of 1-1 relationship between tables in ACCESS
Two tables after establishing a relationship will show up like this

This relationship is automatically saved by Access without saving . Recently we have created the most basic relationship, next, choose each table to see if there is anything different from the beginning.

You open the table tblNhanvien.

Picture 6 of 1-1 relationship between tables in ACCESS
The tblNhanvien table has not seen a change

Normally on the left side of each record, you will see a small plus sign by default. When creating a relationship, Access automatically adds a child datasheet to the table.

Picture 7 of 1-1 relationship between tables in ACCESS
A child datasheet appears when you click on the small plus sign before the record

Click the plus sign and you will see information related to the records available on the tblHRData table .

Picture 8 of 1-1 relationship between tables in ACCESS
Enter the required information right in this datasheet

Click on the Save icon and open tblHRData, you will see the entered data already here.

Picture 9 of 1-1 relationship between tables in ACCESS
Data entered directly in tblNhanvien table are connected and appear in table tblHRData

Previous article: Establish relationships between tables in Access 2016

Next lesson: 1-n relationship between tables in ACCESS

Update 18 June 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile