Sum of Field in Listbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a listbox with 3 columns and I have added an control that will store
the sum of the numbers in column 3 of the listbox. I tried something like
this in the default value of the control but it doesn't seem to work:

= Sum(Var(listboxname).Column(2))

Is this the correct way of doing it? Thanks.
ck
 
CK,

As far as I know, you won't be able to do this by reference to the
listbox itself. You will need to refer to the query that the listbox's
Row Source comes from. One option would be to make a Continuous View
subform based on this query, and you will be able to put a calculated
control in the footer of this form to get the Sum. Another would be to
use a domain aggregate function in your existing textbox, like this...
=DSum("[YourThirdField]","YourQuery")
 
Back
Top