ACC: Cannot Create Relationship with Multiple-Field Primary Key (155514)
The information in this article applies to:
- Microsoft Access 2.0
- Microsoft Access for Windows 95 7.0
- Microsoft Access 97
This article was previously published under Q155514 Novice: Requires knowledge of the user interface on single-user computers.
SYMPTOMS
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.
In Microsoft Access 2.0
-----------------------
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.
CAUSE
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.
RESOLUTION
There are two ways to work around this error:
- Reorder the PrimaryKey fields in the index so that they appear in the
same order as they do in Design view of the table.
- Order the field names in the Relationships dialog box to match the order
of the field names in the PrimaryKey index.
STATUS
Microsoft has confirmed this to be a problem in Microsoft Access 2.0, 7.0,
and 97.
REFERENCES
For more information about using a multiple field primary key, please see
the following article in the Microsoft Knowledge Base:
98793 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?"
Modification Type: | Major | Last Reviewed: | 5/9/2003 |
---|
Keywords: | kbbug kberrmsg KB155514 |
---|
|