ACC: "Invalid Use of Null" with SysCmd() FunctionLast reviewed: May 21, 1997Article ID: Q124160 |
The information in this article applies to:
SYMPTOMSModerate: Requires basic macro, coding, and interoperability skills. When you use the SysCmd() function in Access Basic code, you may receive the error message "Invalid use of Null."
CAUSEThis error message occurs when the SysCmd() function returns a null value and the return variable is declared as any data type other than Variant.
RESOLUTIONMake sure that the return variable for each call to the SysCmd() function has a Variant data type. STATUS This behavior no longer occurs in Microsoft Access version 7.0.
MORE INFORMATIONThe only Access Basic data type that can hold a null value is the Variant data type. Since the SysCmd() function frequently returns a null value, the return variable should have the Variant data type, as in the following example:
Dim ReturnVal As Variant ReturnVal = SysCmd(4, "Status Bar Text Message")NOTE: In Microsoft Access version 2.0, you can replace the "4" in the above example with "SYSCMD_SETSTATUS" (a new constant in version 2.0). If you do not explicitly declare the return variable's data type, it is implicitly declared as a Variant data type, so the following example works as well:
Dim ReturnVal ReturnVal = SysCmd(4, "Status Bar Text Message") Steps to Reproduce Behavior
REFERENCESFor more information about using the SysCmd() function in Microsoft Access version 2.0, search for "SysCmd," and then "SysCmd Function" using the Microsoft Access 2.0 Help menu. |
Keywords : kberrmsg kbusage SynFnc
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |