The information in this article applies to:
SYMPTOMS
Moderate: Requires basic macro, coding, and interoperability skills.
-or
CAUSE
The AutoLookup query contains a Yes/No data type field from the "one" side
table. For Yes/No fields, Microsoft Access automatically enters a 0 (zero)
as the default value.
RESOLUTIONThere are two possible workarounds for using a Yes/No field in an AutoLookup query. Your choice depends on whether you need to modify the Yes/No field in the "one" side table. Method 1If you want to add records to the "many" side table, but only display (not modify) the Yes/No field from the "one" side table, you can work around the hidden default value for Yes/No fields by using an expression in the query grid. For example, you can replace a Yes/No field reference such as
with the expression:
Because an expression is used to output the field instead of a direct
reference, Microsoft Access does not try to set the value of the Yes/No
field in the "one" side table when you add records to the AutoLookup query.
A side-effect of this workaround is that you cannot modify the Yes/No field
in the "one" side table.
Method 2CAUTION: This method involves modifying the design of the "one" side table. If your application has multiple queries, forms, reports, and modules based on the table, this change may affect their behavior. To avoid potential side-effects caused by the design change, you should use Method 1 as the resolution for this issue.If you need to modify the Yes/No field in the "one" side table and add records to the "many" side table, you can change the field's data type from Yes/No to Number. Then, you can set the field's FieldSize and Validation Rule properties to simulate the behavior of a Yes/No data type field. To do so, follow these steps:
STATUSMicrosoft has confirmed this to be a problem in Microsoft Access 7.0. This problem no longer occurs in Microsoft Access 97. MORE INFORMATIONSteps to Reproduce Problem
REFERENCES
For more information about AutoLookup queries, search for "AutoLookup
queries," and then "About AutoLookup queries that enter data
automatically" using the Microsoft Access 97 Help Index.
Q116062 ACC2: Adding Records to AutoLookup Form Generates Error Additional query words: #3341
Keywords : kberrmsg kbusage QryFixup |
Last Reviewed: November 11, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |