View Full Version : Unique Index Error Message


phil4
12-06-2003, 07:43 AM
I am trying to establish a one to many relationship between two tables similar to the one in Northwind where the Products table is related to the Order Details table in a one to many relationship via the ProductID field. I am getting a error report as follows: "No unique index found for the referenced field of the primary table"

Can anyone advise what this means & how to get around it?

Thank you

Jack Cowley
12-06-2003, 10:02 AM
The ProductID field in the Products table should be an autonumber and the Primary Key for the table. It should look bold in your Relationship window. The ProductID in the related table should be a Long Interger data type and does not need to be a compound key as in the Northwinds example.

Here is an example:

tblProducts
ProductID (Primary key and autonumber)
ProductName
...other fields...

tblDetails
DetailsID (Primary key and autonumber)
ProductID (Foreign key and long integer)
...other fields...

hth,
Jack