Home > Articles > Home & Office Computing > Microsoft Applications

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Ensuring Referential Integrity

Table relationships must obey standards of referential integrity, a set of rules that control how you can delete or modify data between related tables. Referential integrity in table relationships keeps users from accidentally deleting or changing related data. You can apply referential integrity when: the common field is the primary table’s primary key; the related fields have the same format; or both tables belong to the same database. If a primary table contains a list of employees and related tables contain additional information about those employees, and an employee quits, his record is removed from the primary table. His records should also be removed in all related tables. Access allows you to change or delete related data, but only if these changes are cascaded through the series of related tables. You can do this by selecting the Cascade Update Related Fields and Cascade Delete Related Records check boxes in the Edit Relationships dialog box.

Ensure Referential Integrity

  • yellow_1.jpg Click the Database Tools tab.
  • yellow_2.jpg Click the Relationships button.
  • yellow_3.jpg Click the join line for the relationship you want to work with.
  • yellow_4.jpg Click the Edit Relationships button.
  • yellow_5.jpg Click to select the Enforce Referential Integrity check box to ensure that referential integrity always exists between related tables in the database.
  • yellow_6.jpg If you want changes to the primary field of the primary table automatically copied to the related field of the related table, click to select the Cascade Update Related Fields check box.
  • yellow_7.jpg If you want Access to delete records in the related tables whenever records in the primary table are deleted, click to select the Cascade Delete Related Records check box.
  • yellow_8.jpg Click OK.
  • + Share This
  • 🔖 Save To Your Account