How to Fix Microsoft Access Relationships and Referential Integrity Errors
Question details
The user needs to resolve an error preventing the enforcement of referential integrity between parent and child tables in Microsoft Access.

- 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 modifying or deleting records in your related tables, always create a backup copy of your Access database to prevent accidental data loss.
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.
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).
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.
If the child record is obsolete or entered by mistake, select the row containing the orphan record and press 'Delete' on your keyboard.
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.
Navigate to 'Database Tools' > 'Relationships'. Double-click the relationship line connecting the two tables, check the 'Enforce Referential Integrity' box, and click 'OK'.

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. Download the software: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install WPS Office: Run the installer and follow the simple on-screen prompts to set up the suite on your computer.
- 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.

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.




