ACC: Variable Not Defined Error with Yes/No Arguments (140288)
The information in this article applies to:
- Microsoft Access for Windows 95 7.0
- Microsoft Access 97
This article was previously published under Q140288
Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
When you use a Yes or a No argument with a method of the DoCmd object, you
may receive the following error message when you attempt to compile the
module:
Variable not Defined.
CAUSE
When you use a method of the DoCmd object in Visual Basic for Applications,
Microsoft Access 7.0 and 97 will not accept a Yes or No argument. Yes and
No are not system-defined constants. Unless otherwise user-defined, their
values are Null.
RESOLUTION
Use True or -1 for the argument instead of Yes, and use False or 0 (zero)
instead of No.
True and False are system-defined constants in Microsoft Access 7.0 and 97.
The value of the constant True is -1, and the value of the constant False
is 0. You can use the constant and its value interchangeably.
REFERENCES
For more information about system-defined constants, search the Help Index
for "constants, system-defined," or ask the Microsoft Access 97 Office
Assistant.
Modification Type: | Major | Last Reviewed: | 10/22/2003 |
---|
Keywords: | kberrmsg kbprb kbusage KB140288 |
---|
|