logo
search
Others

How to Fix Microsoft Access Relationships and Referential Integrity Errors

Emma BrownEmma Brown Sep 28, 2026 869 views

Question details

The user needs to resolve an error preventing the enforcement of referential integrity between parent and child tables in Microsoft Access.

How to Fix Microsoft Access Relationships and Referential Integrity Errors
Product
Microsoft Access
Device & OS
not provided
Scenario
Establishing table relationships and enabling referential integrity rules in an Access database.
Observed behavior
Access displays an error and refuses to enforce referential integrity because a foreign-key value in the child table does not match any existing primary-key value in the parent table.
Before you start

Before modifying or deleting records in your related tables, always create a backup copy of your Access database to prevent accidental data loss.

Solution 1Recommended

Locate and Resolve Orphan Records

To enforce referential integrity, you must first ensure that every foreign-key value in the child table matches a valid primary-key value in the parent table.

Referential integrity ensures that relationships between records remain valid. When a child table contains a foreign-key value (e.g., PropertyID 2) that does not exist in the parent table, it is called an orphan record. Access blocks referential integrity enforcement until these inconsistencies are cleared.

1
Identify unmatched values

Open your child table (e.g., tbl_Rentals) in Datasheet View and look for foreign-key values that do not exist in the primary-key field of your parent table (e.g., tbl_Property).

2
Update the foreign-key value

If the record is valid but assigned to the wrong parent, change the foreign-key value in the child table to a primary-key value that currently exists in the parent table.

3
Delete the orphan record

If the child record is obsolete or entered by mistake, select the row containing the orphan record and press 'Delete' on your keyboard.

4
Restore the missing parent record

If the parent record was accidentally deleted, open the parent table and recreate the record using the missing primary-key value so the child table has a valid reference.

5
Enforce referential integrity

Navigate to 'Database Tools' > 'Relationships'. Double-click the relationship line connecting the two tables, check the 'Enforce Referential Integrity' box, and click 'OK'.

Locate and Resolve Orphan Records
Pro Tip for Large Databases: If your tables contain thousands of rows, use the 'Find Unmatched Query Wizard' under the 'Create' tab to instantly generate a list of all orphan records.
Free Microsoft Office alternative

Need a Lightweight Alternative for Data Management? Try WPS Office

While Microsoft Access is a dedicated relational database tool, many users find that their data tracking, reporting, and analysis needs can be handled more efficiently in a robust spreadsheet program. WPS Office is a highly compatible, free alternative to Microsoft Office that offers powerful data tools.

  1. 1. Download the software: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Install WPS Office: Run the installer and follow the simple on-screen prompts to set up the suite on your computer.
  3. 3. Open and manage your data: Export your simple Access data to CSV or Excel formats, then open them instantly in WPS Spreadsheet for seamless data analysis.
100% compatibility with Microsoft Excel (.xlsx), Word, and PowerPoint formats.Advanced data filtering, pivot tables, and lookup functions in WPS Spreadsheet.Completely free to use with a lightweight installation package.Familiar ribbon interface ensures a zero-learning-curve migration.
microsoft office alternative - wps office

Frequently Asked Questions

What does referential integrity mean in Microsoft Access?

Referential integrity is a set of rules Microsoft Access uses to ensure that relationships between records in related tables remain valid. It prevents users from accidentally deleting or changing related data, which could result in orphan records.

Why is the 'Enforce Referential Integrity' checkbox grayed out?

This checkbox may be disabled if the related fields in your parent and child tables do not have identical data types or field sizes. Open both tables in Design View and verify that the primary-key and foreign-key fields share the exact same data type configuration.

How do I find unmatched records in a large Access database?

You can easily find unmatched records by clicking the 'Create' tab on the ribbon, selecting 'Query Wizard', and choosing the 'Find Unmatched Query Wizard'. Follow the prompts to compare your child table against your parent table to reveal any orphan records.

Can I enforce referential integrity if one of the tables is entirely empty?

Yes. If the child table is empty, there are no existing records to violate the referential integrity rules, meaning you can successfully check the box and enforce the relationship before data entry begins.