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.
 
Hi,
Check out DSum in Help. Just use the same query your list box
is based on.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top