Access Enforce Referential Integrity Error: Relationship must be on the same number of fields with the same data types

2.2k views Asked by At

In Access 2013, I am trying to link an AutoNumber with the field size set to "Replication ID" to another table with "Enforce Referencial Integrity" enabled.

However, I am unable to find a field type that does not provide a "Relationship must be on the same number of fields with the same data types" error.

2

There are 2 answers

0
Arthur Uzulin On BEST ANSWER

I have found an answer.

The Number data type has several options for the size of the field, one of such options is "Replication ID", with the field set as such, I was able to successfully create the relationship.

0
kolcinx On

To create a relationship with "Enforce referential Integrity" between two fields, the fields Data Type and Field Size must be the same.
You can have for exapmple two tables you want to join.

Table Projects (primary key ID):

Field Name        Data Type      Field Size
ID                AutoNumber     Long Integer

Table Tasks (foreign key ProjectID):

Field Name        Data Type      Field Size
ProjectID         Number         Integer

Access will let you join these fields, but will not let you check "Enforce referential integrity".