[ bobby63 @ 26.10.2005. 11:02 ] @
Više puta sam imao problem u slučajevima kada Nz ne pomaže, tj kada neko polje (npr rezultat Query-ja) u datom trenutku ne postoji. Ova fukcija rešava taj problem i daje 0 u takvom slucaju.


Public Function NullToZero(TheValue As Variant)

'This function converts Null to Zero It also converts Non Existing Data to Zero

On Error GoTo NullToZero_Err
If IsNull(TheValue) Then
NullToZero = 0
Else
NullToZero = TheValue
End If
Exit Function

NullToZero_Err:
'This function would only generate an error if the data in TheValue doesn't exist at all.
NullToZero = 0
Exit Function

End Function

Nadam se da će ovo nekome biti korisno.

PS
Da ne ispadne da se hvalim da sam autor, funkciju sam nasao na internetu.