Public Function IsNothing(varToTest As Variant) As Boolean
'*****************************************************************
'Name : IsNothing (Function)
'Purpose : Verifie if the Test Variable is Empty
'Author : Alessandro Baraldi
'E.Mail : ik2zok@libero.it
'Date : 23 gennaio 2002
'Called by :
'Calls :
'Inputs : Variant
'Output : Boolean
'*****************************************************************
IsNothing = True
Select Case VarType(varToTest)
Case vbEmpty
Exit Function
Case vbNull
Exit Function
Case vbBoolean
If varToTest Then IsNothing = False
Case vbByte, vbInteger, vbLong, vbSingle, vbDouble, vbCurrency
If varToTest <> 0 Then IsNothing = False
Case vbDate
IsNothing = False
Case vbString
If (Len(varToTest) <> 0 And varToTest <> " ") Then IsNothing = False
Case vbVariant
If IsArray(varToTest) And UBound(varToTest) + 1 > 0 Then IsNothing = False
End Select
End Function
|