A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Summing a column in a report



 
 
Thread Tools Display Modes
  #1  
Old March 20th, 2010, 01:37 PM posted to microsoft.public.access.reports
cinnie
external usenet poster
 
Posts: 67
Default Summing a column in a report

My report has a column of numbers. Below the column, I would like to show a
text box with the sum of these numbers. In Excel I would just use something
like "= Sum(C3:C56)", but I don't know how to do this in Access. My real
problem is that each report has a different number of rows. Any clues??
Thanks
--
cinnie
  #2  
Old March 20th, 2010, 01:51 PM posted to microsoft.public.access.reports
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default Summing a column in a report

cinnie,
If you had an uncalculated bound text control named Price, with
numeric values...
= Sum(Price)
would yield the Sum of Price in any Group Footer, or Report Footer.
--
hth
Al Campagna
Microsoft Access MVP 2007-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"cinnie" wrote in message
...
My report has a column of numbers. Below the column, I would like to show
a
text box with the sum of these numbers. In Excel I would just use
something
like "= Sum(C3:C56)", but I don't know how to do this in Access. My real
problem is that each report has a different number of rows. Any clues??
Thanks
--
cinnie



  #3  
Old March 20th, 2010, 01:58 PM posted to microsoft.public.access.reports
John Spencer
external usenet poster
 
Posts: 7,815
Default Summing a column in a report

Use the report footer or a group footer (report footer if you want to sum the
entire report and group footer if you want to subtotal by groups of records)
and add a control to the footer with its control source set to sum the
relevant field. Something Like

ControlSource: =Sum([Amount])



John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

cinnie wrote:
My report has a column of numbers. Below the column, I would like to show a
text box with the sum of these numbers. In Excel I would just use something
like "= Sum(C3:C56)", but I don't know how to do this in Access. My real
problem is that each report has a different number of rows. Any clues??
Thanks

  #4  
Old March 20th, 2010, 02:56 PM posted to microsoft.public.access.reports
cinnie
external usenet poster
 
Posts: 67
Default Summing a column in a report

thanks Al and John. I think the reason Control Source: = Sum([txtA])
doesn't work is that txtA is from a XTab query. It is calculated based on a
Count. Does that mean I can't use 'Sum([txtA])' to sum these values? thanks
again
--
cinnie


"Al Campagna" wrote:

cinnie,
If you had an uncalculated bound text control named Price, with
numeric values...
= Sum(Price)
would yield the Sum of Price in any Group Footer, or Report Footer.
--
hth
Al Campagna
Microsoft Access MVP 2007-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"cinnie" wrote in message
...
My report has a column of numbers. Below the column, I would like to show
a
text box with the sum of these numbers. In Excel I would just use
something
like "= Sum(C3:C56)", but I don't know how to do this in Access. My real
problem is that each report has a different number of rows. Any clues??
Thanks
--
cinnie



.

  #5  
Old March 20th, 2010, 03:17 PM posted to microsoft.public.access.reports
Duane Hookom[_4_]
external usenet poster
 
Posts: 316
Default Summing a column in a report

You can Sum() numeric values from crosstab or other queries. Make sure you
are not attempting to sum in the Page Footer section.

I'm confused why you would name a column/field "txtA" when "txt" is
generally a prefix for either a text box or a field/variable storing a
text/string value.

If it is a text box, you can't Sum() a control.

--
Duane Hookom
MS Access MVP


"cinnie" wrote in message
...
thanks Al and John. I think the reason Control Source: = Sum([txtA])
doesn't work is that txtA is from a XTab query. It is calculated based on
a
Count. Does that mean I can't use 'Sum([txtA])' to sum these values?
thanks
again
--
cinnie


"Al Campagna" wrote:

cinnie,
If you had an uncalculated bound text control named Price, with
numeric values...
= Sum(Price)
would yield the Sum of Price in any Group Footer, or Report Footer.
--
hth
Al Campagna
Microsoft Access MVP 2007-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."

"cinnie" wrote in message
...
My report has a column of numbers. Below the column, I would like to
show
a
text box with the sum of these numbers. In Excel I would just use
something
like "= Sum(C3:C56)", but I don't know how to do this in Access. My
real
problem is that each report has a different number of rows. Any
clues??
Thanks
--
cinnie



.

  #6  
Old March 20th, 2010, 04:38 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Summing a column in a report

cinnie wrote:

My report has a column of numbers. Below the column, I would like to show a
text box with the sum of these numbers. In Excel I would just use something
like "= Sum(C3:C56)", but I don't know how to do this in Access. My real
problem is that each report has a different number of rows.



Be careful here. The word "field" and the word "control"
mean two different things. This is one of those times when
the difference between a control bound to a field and a
record source field is very important.

When using an aggregate function (Count, Sum, etc), you must
use FIELDs from the report's record source table/query. You
can not use a control on the report.

--
Marsh
MVP [MS Access]
  #7  
Old March 20th, 2010, 11:39 PM posted to microsoft.public.access.reports
cinnie
external usenet poster
 
Posts: 67
Default Summing a column in a report

Yes, that was it! What I had already done was consistent with the good
advice from all of the experts that replied. But still nothing worked. You
identified the key point - that the numbers being summed were derived from an
aggregate function, so the underlying query's field had to be used, not the
report's control. Thanks for a great insight.
--
cinnie


"Marshall Barton" wrote:

cinnie wrote:

My report has a column of numbers. Below the column, I would like to show a
text box with the sum of these numbers. In Excel I would just use something
like "= Sum(C3:C56)", but I don't know how to do this in Access. My real
problem is that each report has a different number of rows.



Be careful here. The word "field" and the word "control"
mean two different things. This is one of those times when
the difference between a control bound to a field and a
record source field is very important.

When using an aggregate function (Count, Sum, etc), you must
use FIELDs from the report's record source table/query. You
can not use a control on the report.

--
Marsh
MVP [MS Access]
.

  #8  
Old March 21st, 2010, 01:59 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Summing a column in a report

cinnie wrote:

Yes, that was it! What I had already done was consistent with the good
advice from all of the experts that replied. But still nothing worked. You
identified the key point - that the numbers being summed were derived from an
aggregate function, so the underlying query's field had to be used, not the
report's control. Thanks for a great insight.



You're welcome, but I see that Duane was making the same
point earlier.

--
Marsh
MVP [MS Access]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:23 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.