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  

Report Subtotal



 
 
Thread Tools Display Modes
  #1  
Old August 27th, 2009, 03:16 AM posted to microsoft.public.access.reports
Theresa
external usenet poster
 
Posts: 176
Default Report Subtotal

I am using Access 2007. I have created a report based on a query. In the
query I have created a calculated field and I have included this field in the
detail section of my report. I want to be able to subtotal this field on my
report. I created the text box in the page footer, but keep getting #Error
as the result.

Why is this not working?
  #2  
Old August 27th, 2009, 04:08 AM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Report Subtotal

Theresa wrote:

I am using Access 2007. I have created a report based on a query. In the
query I have created a calculated field and I have included this field in the
detail section of my report. I want to be able to subtotal this field on my
report. I created the text box in the page footer, but keep getting #Error
as the result.

Why is this not working?



Because a page is not a data specified set of values. You
can use the Sum function on the entire report and/or any
level of report grouping, but not in a page header or
footer.

If you really need to get page subtotals, use a running sum
text box in the detail section and some code:

This line goes at the top of the report module, before any
sub or function procedures.
Dim PreviosPageTotal

Put this kibd of thing in the page footer section's Print
(or Format) event.
Me.[page footer text box] = Me.[running sum text box] -
PreviosPageTotal
PreviosPageTotal = Me.[running sum text box]

It might not be necessary in your case, but you shouldalso
add a line of code in the report header section's Print (or
Format) event:
PreviosPageTotal = 0

--
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 02:21 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.