Using a primary key to create arelationship in Microsoft Access 2019

Once a primary key is assigned to a field in a table, you can connecttwo or more tables using the Relationships windows. Let’s try thisnow:

  1. We will continue with the previous database example. Click on Database Tools | Relationships:
ms office 597
  1. If the Relationships window doesnot contain any tables, you will need to add them to relate them to eachother. Click on the Show Table icon toselect the relevant tables from the list. For this example, we will addboth the Employees and the SalaryInfo tables. Tables may be addedindividually or selected using the Ctrl key on thekeyboard. Click on the Add icon toplace the tables onto the relationship window.
  1. Locate the Employees table. Thistable contains a primary key called ID. It is indicated via the primary key iconto the left of the ID field. Click onthe ID field, and while holding downyour left mouse button, drag the IDfield out of the Employees Table overthe ID field in the SalaryInfo table, then let go of themouse:
ms office 515
  1. The Edit Relationships dialog boxwill appear and the correct tables and relationship will be identifiedunless the user had made a mistake. Click on Create to complete the relationship. Therelationship is evident in the Relationship Window by a solid line fromone table field to the next. Click on the Close icon on the ribbon to exit therelationship window.
  2. Click Yes to save the relationshipwhen prompted by the dialog box.

Leave a Comment