ACC: AutoLookup Query Not Performed with 1-to-1 RelationshipLast reviewed: May 29, 1997Article ID: Q121332 |
The information in this article applies to:
SYMPTOMSModerate: Requires basic macro, coding, and interoperability skills. Microsoft Access will not perform an AutoLookup query if it determines that the tables in the query have a one-to-one relationship.
CAUSEMicrosoft Access determines the relationship between the tables in the query by examining the indexes on the join fields. Microsoft Access will ignore the relationship that you specify when it is determining whether to perform an AutoLookup query. If your tables have one of the following index combinations, Microsoft Access will not perform an AutoLookup query:
Table 1 Table 2 ---------------------- ---------------------- Primary Key Primary Key Primary Key Indexed, No Duplicates Indexed, No Duplicates Primary Key RESOLUTIONTo cause Microsoft Access to perform an AutoLookup query, make sure that the foreign key is neither indexed as the Primary Key nor Indexed, No Duplicates. It may be necessary to add a unique index to the foreign key on the "many" side of a relationship in order to maintain the integrity of the data. In this case, AutoLookup will not work and a workaround will have to be used.
MORE INFORMATIONConsider the following tables:
Employees Offices ---------- ---------- EmployeeID OfficeID LastName AssignedToTo ensure that an employee is not assigned to more than one office, add a unique index to the Offices.[AssignedTo] field. Regardless of whether there is no relationship, a one-to-many relationship, or a one-to-one relationship defined between these tables, Microsoft Access will determine that the relationship is one-to-one when determining whether to perform an AutoLookup query.
Steps To Reproduce Behavior
REFERENCESFor more information about AutoLookup queries, search the Help Index for "AutoLookup queries," or ask the Microsoft Access 97 Office Assistant.
|
Additional query words: row fix-up updateable
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |