How relationships affect a query result in Microsoft Access 2019

In the explanation that follows, we will learn how to deleterecords from a table using a Deletequery. It is important to note that you would need to make sure thatEnforce Referential Integrity, as wellas Cascade Delete Related Records, isselected in the table relationships before youcreate the Delete query. This ensuresthat all records relating to code 417 (MEAKER) are removed from alltables throughout the database:

  1. Click on the Relationships icon onthe DatabaseTools tab, as illustrated in the followingscreenshot:
ms office 762
  1. The Relationships window willlaunch and display all related tables, indicating the relationshipsbetween them. If the relationship window is empty, clickthe ShowTable icon to add tables to the window and relatethem to each other using the primary keys from each table, asillustrated in the following screenshot:
ms office 624
  1. To enforce referential integrity, right-click on the relationshipline between the ElkPupilsTbl table andthe ResultsTbl table.
  2. Select the EditRelationship… option from the drop-down listprovided. Alternatively, click on the line between the two tables andselect the EditRelationship icon on the Tools group. 
  1. The EditRelationships dialog box will open. Click thecheckboxes to select EnforceReferential Integrity and Cascade Delete Related Records, asillustrated in the following screenshot:
ms office 618
  1. Click the OK button to confirm. Selectthe Close icon onthe Relationships group.

Leave a Comment