relational error message

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Access Training and help » Relational Error Message

Relational Error Message

resolvedResolved · Medium Priority · Version 2007

Danny has attended:
Access Introduction course
Access Intermediate course
Access Advanced course
Access VBA course

Relational Error Message

"relationship must be on the same number of fields with the same data types access"

When i try to do a 1-many relation and enforce integrity the above message comes up?

thanks, Dan

RE: Relational Error Message

Not to worry, All sorted,

field type has to match the join,

i.e. on my database i have clients with many sites, so on my client table their is a field called Client_site_code, was set as a text field, yet in the sites table the field Client_site_code was set as an autonumber as it was the primary key.

only responded if anyone else has this problem.

RE: Relational Error Message

Hi Danny,

Thank you for your question.

The issue seems to be that your Primary and Foreign Keys do not contain the same Data Type and/or Field size.

E.g. If the Primary key is an Autonumber Data Type, then the Foreign key has to be a Number Data Type and Long Integer.

E.g. If the Primary key was a Number Data Type and the field size was Integer, then the Foreign Key must be Number Data Type and Integer Field Size.

E.g. If the Primary Key was Text Data Type and 200 Field size, then the Foreign Key must be Text Data Type and Field Size 200.

So you need to go into the tables containing the Foreign Keys and ensure the Data Type and Field sizes are the same as the Primary Keys. Once you have edited those keys then try the relationships again.

I hope this answers your question.

Regards

Simon

Sun 25 Sep 2011: Automatically marked as resolved.


 

Access tip:

Space marks

It is good practice not i to have space marks for field names as this can lead to problems when using queries or VBA code. It is much better to use an underscore charcter to represent spaces in field names

View all Access hints and tips


Server loaded in 0.09 secs.