ACC: Can't Create Relationship with Multiple-Field Primary KeyID: Q155514
|
Novice: Requires knowledge of the user interface on single-user computers.
When you try to create a relationship that enforces referential integrity,
and the relationship involves a multiple-field primary key, you may receive
the following error.
In Microsoft Access 7.0 and 97
------------------------------
No unique index found for referenced field of primary table.
Can't create relationship to enforce referential integrity. The field(s) in the primary table must be the primary key or have a unique index.
The order of the primary key fields in Design view of the table is different from the order of the fields in the PrimaryKey index.
There are two ways to work around this error:
Microsoft has confirmed this to be a problem in Microsoft Access 2.0, 7.0, and 97.
Table:
------------------
Field Name: A
Data Type: Text
Field Name: B
Data Type: Text
Index Name Field Name Sort Order
------------------------------------
PrimaryKey B Ascending
A Ascending
Table/Query: tblOne Related Table/Query: tblTwo
-------------------------------------------------
A A
B B
For more information about using a multiple field primary key, please see
the following article in the Microsoft Knowledge Base:
Q98793 ACC: Compound Indexes Must Restrict First Indexed Field
For more information about enforcing referential integrity, type "What is
Referential Integrity" in the Office Assistant, click Search, and then
click to view "What is Referential Integrity?"
Additional query words: index multiple field primary key
Keywords : kberrmsg RltRef
Version : 2.0 7.0 97
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: April 26, 1999