Friday's easiest question about report totals

kblehman

Registered User.
Local time
Today, 05:09
Joined
May 11, 2007
Messages
22
I'm having a major brain fart on how to do a simple sum of a column on a report. I tried to figure it out by going into the Northwind database but the solution didn't leap out at me there either.

I have a report that's based on a query. One of the query columns is called LayfTotal, which represents the number of people laid off for each record in the filtered query, but I need to show a report total, too.

I added a text box called txtLayoffTotals to the Report Footer. Now I need to add up the number in each of the LayfTotal fields on the report and display it in txtLayoffTotals.

Do I create a separate column in the query and do the summing there or should it be done right on the report? If so, how?

Thanks in advance.
 
Yes, but where does that go?
 
as the controlsource of your txtLayoffTotals. you may have to create a runsum.. do a search on that if this doesnt work for u
 
That's what I thought. I put it in the control source of txtLayoffTotals, but when I run the report I get prompted to enter a parameter value for it. It's not automatically summing all the LayfTotal fields.
 
Rainman,

I'm using =sum(LayfTotal) for the control source of the text box, but instead of summing the numbers in the LayfTotal column I'm getting prompted to enter a parameter. If I enter "1" the total becomes 29; if I enter "2" the total shows as 58. (The number of records for the 4/1/07 - 4/30/07 date range entered equals 29.)

Here's a copy of the DB. I edited out 75% of the records to minimize the size.

The report in question is rptPltClosing-LayoffAct. It is dependent on the dates on this form: frmRptCriteria.

Thank you in advance for your help.
Kerry
 

Attachments

Ok have a look at what i did. instead of trying to runsum the layftotal box. create a new txtbox called runsumlayftotal that has a control source of layftotal and runsum over that.
 

Attachments

Well, you're not going to believe this. The example in your zip file worked just fine; gave me a total of the layoff column. But when I copied =[runsumLayfTotal] into the control source of txtLayoffTotals in my original DB, I got the same result as before. A msg box asking me to enter a parameter for runsumLayfTotal.

I double-checked everything and I had it set up the very same way, but no luck. So I used my last resort: renamed my report and imported yours. That took care of it, now it's showing the total just fine.

I don't get it. Could my report have been corrupt? Why else would the exact same statement not work for me? Oh well. At least I got it to work.

Thanks very much for your help, rainman. Have a great day.
 
i think that one of the txt boxes had a runsum on it but it didnt need it. so that was your problem i believe!
glad you got it figured out. take care
 

Users who are viewing this thread

Back
Top Bottom