Hello All,
if I have a list box containing a column for expenditure, how do I calculate the total expenditure and show it in the list box?
Regards
how to show show total in list box?
-
- BronzeLounger
- Posts: 1227
- Joined: 01 May 2016, 09:58
-
- Administrator
- Posts: 78488
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: how to show show total in list box?
You could create a Totals query that returns the sum of Expenditure.
Then create a Union query that combines the current source of the list box and the totals query.
Set the Row Source of the list box to this union query.
But wouldn't it be easier to display the total in a separate text box?
Then create a Union query that combines the current source of the list box and the totals query.
Set the Row Source of the list box to this union query.
But wouldn't it be easier to display the total in a separate text box?
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1227
- Joined: 01 May 2016, 09:58
Re: how to show show total in list box?
Thank you very much for the reply,
how to display the total in the text box, please?
Regards
how to display the total in the text box, please?
Regards
-
- Administrator
- Posts: 78488
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: how to show show total in list box?
Set its Control Source to
=DSum("Expenditure","NameOfTableOrQuery")
where NameOfTableOrQuery is the table or query that acts as Row Source of the list box.
=DSum("Expenditure","NameOfTableOrQuery")
where NameOfTableOrQuery is the table or query that acts as Row Source of the list box.
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1227
- Joined: 01 May 2016, 09:58
Re: how to show show total in list box?
thank you very much for the answer. I will try this