ACC2000: AutoLookup Query Not Performed with a One-to-One RelationshipID: Q208916
|
Microsoft Access does not perform an AutoLookup query if it determines that the tables in the query have a one-to-one relationship.
Access determines the relationship between the tables in the query by examining the indexes on the join fields. Access ignores 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, Access does not perform an AutoLookup query:
Table 1 Table 2
---------------------- ----------------------
Primary Key Primary Key
Primary Key Indexed, No Duplicates
Indexed, No Duplicates Primary Key
To cause Access to perform an AutoLookup query, make sure the foreign key is neither indexed as the Primary Key nor as Indexed, No Duplicates. You may have 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.
Consider the following tables:
Table: Employees
----------------------------
Field Name: EmployeeID
Data Type: AutoNumber
Indexed: Yes (No Duplicates)
Field Name: LastName
Data Type: Text
Table Properties: Table1
-------------------------------
PrimaryKey: Category ID
Index1: Category Name; Location
Table: Offices
----------------------------
Field Name: OfficeID
Data Type: AutoNumber
Indexed: Yes (No Duplicates)
Field Name: AssignedTo
Data Type: Text
Table Properties: Table1
-------------------------------
PrimaryKey: Category ID
Index1: Category Name; Location
To ensure that an employee is not assigned to more than one office, add a
unique index to the Offices.[AssignedTo] field. It doesn't matter whether there is no relationship, a one-to-many relationship, or a one-to-one
relationship defined between these tables; Access determines that the relationship is one-to-one when determining whether to perform an
AutoLookup query.
Table: Offices
------------------------
FieldName: OfficeID
Data Type: AutoNumber
Field Size: Long Integer
New Values: Increment
FieldName: Building
Data Type: Text
FieldName: AssignedTo
Data Type: Number
FieldSize: Long Integer
DefaultValue: <blank>
OfficeID Building AssignedTo
--------------------------------
1 A
2 A
3 B
For more information about AutoLookup queries, click Microsoft Access Help on the
Help menu, type autolookup queries in the Office Assistant or
the Answer Wizard, and then click Search to view the topics
returned.
Additional query words: row fix-up updateable prb
Keywords : kbdta QryFixup
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: August 9, 1999