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

relational error message

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

Relational Error Message

ResolvedVersion 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:

Switchboard Startup

An option when you open your Access database that contains all of you tables, forms and queries is only the switchboard is displayed.

To achieve this, select Tools click on Startup. On the right hand side of the Startup screen you are able to select which form you want to open when you open you Access Database. Once you have selected this, there is a check box just below that says "Display Database Window", you need to uncheck this option. Then click ok.

Then when you close you Access database and re open it, the database should open with just the switchboard being shown


View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.11 secs.