Microsoft KB Archive/90722

= ACC: &quot;Invalid Use of Null&quot; Error Message with Val Function =

Article ID: 90722

Article Last Modified on 5/9/2003

-

APPLIES TO


 * Microsoft Access 1.0 Standard Edition
 * Microsoft Access 1.1 Standard Edition
 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition

-



This article was previously published under Q90722



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



SYMPTOMS
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.

