Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

MS Access one-to-one relationship


May 16, 2021 MS Access



Now let's look at the one-to-one relationship in MS Access. This relationship is used to associate one record in one table with a record in another table.

Now let's go to the Database Tools tab.

MS Access one-to-one relationship

Click on the Relationships option.

MS Access one-to-one relationship

Select tblEmployees and tblHRData, then click the Add button to add them to our view, and then close the Display Table dialog box.

MS Access one-to-one relationship

To create a relationship between the two tables, use the mouse, then click and hold the EmployeeID field in tblEmployees, drag and drop the field on the field we want to associate, and hover over the EmployeeID from tblHRData. When you release the mouse button, Access opens the following window -

MS Access one-to-one relationship

The above window associates the Employee ID of tblEmployees with the Employee ID of tblHRData. Let's click the Create button now, and now the two tables are related.

MS Access one-to-one relationship

Relationships are now saved automatically and there is no real need to click the save button. Now that we've created the most basic relationship, let's go to the desktop and see what happens to that relationship.

Let's open the tblEmployees table.

MS Access one-to-one relationship

Here, on the left side of each record, you will see a small plus sign by default. le.

MS Access one-to-one relationship

Let's click on the plus sign and you'll see information about this record on the tblHRData table.

MS Access one-to-one relationship

Click on the Save icon and open tblHRData and you'll see that the data we entered is already here.

MS Access one-to-one relationship