Search code examples
ms-accessrelationshipstable-relationships

Issue with enforcing referential integrity In Access 2013


So I was mapping out the relationships between tables in a database I'm working on but I ran into some problems.

It was recommended to me that I use the "Enforce Referential Integrity" function when working with table relationships but everytime I try and and make more than one relationship between tables it gives me the error: "No unique index found for the referenced field of the Primary table".

If I don't use the "Enforce Referential Integrity" function then it seems to work fine. Will it negativity effect my table if I don't use the function and if yes then how can I solve the error?

Thanks in advance.


Solution

  • The purpose of referential integrity is data integrity, if you won't enforce it, the data may become inconsistent, may appear logical errors, so enforcing is highly recommended. Additionally you can enable cascading and the data from detail table will be deleted or updated automatically if you delete/update the key field in main table.

    As of error, it means that your main table should have primary key or unique index on fields you map to detail table. If main table has primary key with few fields, all those fields should be mapped to detail table.

    Please post the picture of your relationships map and describe which fields should be mapped.