arsicfilip
Technical User
- Oct 29, 2008
- 7
I use this to calculate total sum of column in list box:
Private Sub Command13_Click()
Me!List11.Requery
Dim listrs As Integer
Dim listsum As Integer
listrs = Me![List11].ListCount
Do
listsum = listsum + Me![List11].Column(2, x)
x = x + 1
Loop Until x = listrs
Me![suma].Value = listsum
End Sub
I have problem when query return no record:Invalid use of null.
Is there any way to avoid this?
Private Sub Command13_Click()
Me!List11.Requery
Dim listrs As Integer
Dim listsum As Integer
listrs = Me![List11].ListCount
Do
listsum = listsum + Me![List11].Column(2, x)
x = x + 1
Loop Until x = listrs
Me![suma].Value = listsum
End Sub
I have problem when query return no record:Invalid use of null.
Is there any way to avoid this?