Mr. Fneily
I used your function to sum column.
List box has been used as query result on form from different tables. At some point query return no result because there is no record to show. There isnt null data there is no record to show based on criteria.
Got answer on access forum:
Private Sub Command13_Click()
Dim listsum As Long, x As Integer
With Me!List11
.Requery
For x = 0 To .ListCount - 1
listsum = listsum + Nz(.Column(2, x), 0)
Next
End With
Me!suma.Value = listsum
End Sub
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...
I know this is not ms access forum bur i will ask here question because this solutinon is here.
Here is problem:
when I aplly this formula I get error message "Invalid use of null" when is no records to sum.
How to avoid null error.
Thnx in ahead
Thanks to both of You.
First for asking question (even in wrong forum) and second thanks to the fneily.
Been searching this solutin for 2 days
(sorry for bad english)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.