Calculate List Box Column's Sum

bluesurfer

New member
Local time
Tomorrow, 02:51
Joined
Mar 7, 2009
Messages
5
im having problem with column sum with my listbox when the column have
null values....

1.no sum is generated when i have null values
2.error on this line ***

im using this module

Function ABill2() As Variant
Dim I As Integer, J As Integer, ctl As Control
Set ctl = Forms![formname]!
[ListBoxName]
J = ctl.listCount - 1

ABill2 = 0
For I = 1 To J 'for each row
*** ABill2 = ABill2 + ctl.Column(4, I) 'column 4: totalBilled
Next I

ABill2 = Format(ABill2, "currency")

End Function
 
Have you tried

Nz(ctl.Column(4, I), 0)
 

Users who are viewing this thread

Back
Top Bottom