0
votes
Relationship must be on the same number of fields with the same data types. (Error 3368)
The CONSTRAINT clause you are using to create a relationship includes a different number of fields for each table or includes fields with different data types. Check the number of fields in the CONSTRAINT clause, check the data types of fields to make sure they match, and try again.

I've never ran into this problem before. I have two tables which have a single one-to-many relationship between them. I designated my own primary key from one table to the other. They are both of the same data type (number). Why should it matter if one table has more fields than another? This only seems to happen when I assign my own primary key. The 'many' table is indexed (no duplicates). And I've tried required and and not required for the 'one' table. What gives? I relationship with no referential integrity is allowed, for whatever that's worth.

1
What do you mean by "designated my own primary key"? The error refers to the fields comprising the primary and foreign keys only, not the number of fields in either table. It would be helpful to see the table definitions. - ron tornambe
I mean didn't use the AutoNumber type as the primary key. I instead used a number with meaning in context e.g. 9872 for a primary key instead of the auto number. I'll post an imgur link to a screen shot here shortly. - wootscootinboogie
imgur.com/B4S5i the many side the one side imgur.com/3TG9c - wootscootinboogie
I assume you are using the fkCountry field for the relationship, so what data type is it? Also Decimal? - ron tornambe
fkCounty is a number as while, an integer, no decimal. - wootscootinboogie

1 Answers

2
votes

Decimals and Integers are not considered equivalent numeric types. You must change either CountryPK to Long Integer or the CountryFK to Decimal. You can also use Double on both.