Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

MS Access error: relationships must be on same number of fields with the same data types

Writer Andrew Henderson

I have been assigned to create a database. The information given was to create the database partially from MS Excel, so I figured out how to import the data and create different tables that pertain to my task.

I am, however, unable to create any relationships between MS Access tables. I have double checked that the data types are the same between corresponding tables.

For example:

Table Vendor:

  • VendorID (autonumber)
  • VendorName (short text)

...that I am trying to connect to a Vendor field (short text) within a Product detail table.

I think one of the issues may be that there is duplicate information in the tables because the same vendors pop up multiple times.

I have already created a search query and form but it does not work: I suspect this is due to a lack of relationships between tables.

2 Answers

Make sure you have your VendorID set as the same datatype in both the tables.

N.B: Even if it is stored as a number, make sure they are both long integers. The duplicates shouldn't prevent you from creating a relationship: duplicates restrict only when you try and create a relationship with referential integrity.

I had the same issue. In one table I had guestID as a primary key with the AutoNumber format, and had a 1 to many relationship with guestID in a different table. I must have put the format to Short Text by accident, so when I changed it to Number, it got rid of the problem.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.