Share via

Relationships Error

Anonymous
2018-08-15T19:51:57+00:00

I am trying to update the relationships between my tables (referential integrity and cascade) and I keep getting an error that says "Relationship must be on the same number of fields with the same data types."  I don't understand what this means.  Both  parent field and child field are a number field.  I have other tables where the relationships and integrity are intact, but it doesn't seem to be working for a few select tables.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Tom van Stiphout 40,201 Reputation points MVP Volunteer Moderator
2018-08-15T21:43:35+00:00

Saying they are both "Number" is not enough. The subtypes need to be the same as well. For example two integers, or two long integers, but not a double and a single.

Was this answer helpful?

0 comments No comments

4 additional answers

Sort by: Most helpful
  1. ScottGem 68,810 Reputation points Volunteer Moderator
    2018-08-15T22:26:52+00:00

    Is the parent field set as a PK or unique index? If its not, that could cause that message? Also Number has many subtypes So if one I a Number>Long Integer and the other is a Number>Integer. that would cause a mismatch.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2018-08-15T21:45:21+00:00

    Got it, thanks.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2018-08-15T21:38:40+00:00

    As seen in the picture below, I am trying to make a relationship between HMISID and HMISID in two separate tables.  I have confirmed that they are both number data types.  Is there something else I'm missing here?

    Was this answer helpful?

    0 comments No comments
  4. Tom van Stiphout 40,201 Reputation points MVP Volunteer Moderator
    2018-08-15T20:47:17+00:00

    Let's pick that apart:

    > Relationship must be on the same number of fields

    This means you cannot have a relation from one field in one table to two fields in another table. Probably not your problem in this case.

    > with the same data types.

    This means that the fields in both tables must have the same data type, meaning both integers, or both text, or both dates, but they have to be the same.

    Was this answer helpful?

    0 comments No comments