mardi 5 novembre 2019

If-Then-Else-EndIf VERSUS IIF

I would like know why these following code aren't equals :

test = IIf(CURRENCY_ Is Nothing, " ", IIf(IsEmpty(CURRENCY_.Value), " ", CStr(CURRENCY_.Value)))

and

If CURRENCY_ Is Nothing Then
     test = " "
Else: IsEmpty (CURRENCY_.Value)
     test = CStr(CURRENCY_.Value)
End If

For the first code I obtain the error below:

Object variable or With block variable not set

Someone can help me?

Aucun commentaire:

Enregistrer un commentaire