Public Function IsNULL(ByVal Expression As Variant) As Boolean
Returns True if the specified variable/expression is NULL (database NULL). Only 'Variant' variables/parameters can contain NULL.
Public Function MyFunction(pStartDate As Date, pEndDate As Variant)
If IsNULL(pEndDate) Then pEndDate = #2099-12-31#
...
End Function