ACC: "Invalid Use of Null" Error Message with Val() Function

Last reviewed: June 6, 1997
Article ID: Q90722
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0, 7.0

SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

If you create a function that uses the Val() function to evaluate a field that contains a null value, you may receive the following error message:

    Invalid Use of Null

RESOLUTION

Make sure that the Val() function does not attempt to evaluate a field that contains a null value. Or, if you are not sure, add error trapping to your code to trap for this scenario.

MORE INFORMATION

The Val() function is designed to return the numeric value of a string. When the Val() function attempts to return the numeric value of null, an expression evaluation error occurs. Null is a Variant subtype used to indicate that a data item contains no valid data. Because the Val() function requires valid data, it cannot evaluate a null value.

STATUS

This behavior is by design.

REFERENCES

For more information about the Val() function, search for "Val," and then "Val Function" using the Microsoft Access Help Index.


Keywords : kberrmsg kbprg SynFnc
Version : 1.0 1.10 2.0 7.0
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
Resolution Type : Info_Provided


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 6, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.