The information in this article applies to:
Moderate: Requires basic macro, coding, and interoperability skills. This article applies only to a Microsoft Access database (.mdb). SYMPTOMSCode written in Access Basic that uses "-1" or "0" (with the quotation marks) to compare a Yes/No field in a table or recordset does not work properly when you convert the Access Basic code to Visual Basic for Applications code. In Microsoft Access version 2.0, which uses Access Basic, the numeric comparisons are evaluated as strings. In Microsoft Access 7.0 and later, which use Visual Basic for Applications, the numeric comparisons are evaluated as Boolean values. CAUSEIn Access Basic the condition
is evaluated as True, and the condition
is evaluated as False.In Visual Basic for Applications, these conditions are no longer evaluated in this manner. RESOLUTION
In an open Access Basic or Visual Basic for Application module window, use
the Find command on the Edit menu to check for instances
of the strings "-1" or "0" (with the quotation marks).
in Visual Basic for Applications, change the code so that there are no
quotation marks around the number "-1" or use the word "True" as in the
following example:
-or-
If you are using the following expression in Access Basic:
in Visual Basic for Applications, change the code so that there are no
quotation marks around the number "0" or use the word "False" as in the
following example:
-or-
MORE INFORMATIONSteps to Reproduce Behavior
to read as follows:
REFERENCESFor more information about the Boolean data type, in the Visual Basic Editor, click
Microsoft Visual Basic Help on the Help menu, type "Boolean data type" in
the Office Assistant or the Answer Wizard, and then click Search to
view the topic. Additional query words: prb
Keywords : kbdta CnvOthr PgmOthr |
Last Reviewed: May 25, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |