Obtaining Totals from a List Box

  • Thread starter Thread starter Dale Clarke
  • Start date Start date
D

Dale Clarke

Hello,

I am using Access 2000 on a Win2k system. Is it possible to perform a
sum on a column in a list box? What I would like to do is have a text
box in the footer section of a form and be able to obtain the sum of a
specific column in a list box. I had the following expression in the
control source of an unbound text box in the footer:
=Sum(Forms!TravelExpense!List0.column(4)). When I viewed the form I
received an #Error in the text box. Is there a better way to obtain the
total I need? Any help would be appreciated.
 
Or, if it's value based
loop through the contents of the listbox

dim temp, loopList
temp = 0

for loopList = 1 to listbox.listcount - 1
temp = temp + listbox.Column(4, loopList)
next loopList

textbox.value = temp
 
Back
Top