Function Convert Values Class

BlankToNull

Replace an empty string with a Null value. Leave all other types of values unchanged.

Signature (Visual Basic / VBA)

Public Function BlankToNull( _
    ByVal vValue As Variant _
    ) As Variant

Code Example

    IsNull(BlankToNull("")) = True
    IsNull(BlankToNull(Null)) = True
    IsNull(BlankToNull("Word")) = False
    IsNull(BlankToNull(45)) = False

Parameters

Parameter Description
vValue The value which is to be changed from an empty string to a Null if appropriate. Function returns Null if vValue is an empty string. Function returns vValue unchanged in all other cases.