Addition within a query

battenberg

Burning candles both ends
Local time
Today, 03:12
Joined
Sep 25, 2006
Messages
118
I have a query which returns selected rows from my table, one of the columns in the table is price.

I want to total the price into a text box on the form and run the query in the 'on current' event of the form so it recalculates depending on the record

can anyone give me a pointer please?

thanks
 
I don't get what you are trying to get a sum for. If you are moving between records, it will only be showing one record at a time and therefore the sum of price for an individual record will still be the same.

Can you elaborate a bit?
 
Thanks Bob, but maybe I'm going about it all wrong..?

I have a tblEntertainment which collects data about entertainment expenses our company spends on others, be it a golf day or an evening meal etc...

it is linked to my tblCustomers by customerID and populated by activating a seperate form from a command button on the customer record

as I move through customers records, I want to return a text box with a total entertainment spend for that particular customer on the form.

so I want to look at the expenses table, then filter the records according to the open 'customer' record, sum the value of the returned [entertainmentspend] column then apply that variable to a text box or label. Each time I move between records.

any idea's?
 
Have the customer information on a main form and the entertainment expenses would be a one-to-many that could be displayed on a subform.

You can then have a text box on the subform footer that sums the entertainment expenses using
=Sum([entertainmentspend]
as the text box's recordsource.
 
Thanks Bob, I was going about it in the wrong way!!!!
 

Users who are viewing this thread

Back
Top Bottom