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  

Problems totalling subreport data on main report (A-2002)



 
 
Thread Tools Display Modes
  #1  
Old June 23rd, 2004, 08:01 PM
Marshall Barton
external usenet poster
 
Posts: n/a
Default Problems totalling subreport data on main report (A-2002)

Lewis Moseley wrote:

I have not been able to find any decent source for info on using
subreports and especially summing subreport data on the mail report.
This is giving me fits! Maybe someone can help.

Tables:

-Employees
-Clients (includes first and last date of that clients business year,
also names Employee responsible for the account)
-Client line item information


Report:

Employee (group by)
Client
Client details on a subreport (by client's business year)
Count and total by client (taken from subreport)
Count and total by Employee (DOES NOT WORK)
Count and total for report (DOES NOT WORK)

To explain a little mo The client details are on a subreport
because the "business year" of each client is different and thus the
date range of the detail items varies by client.

The main report is for ALL Clients, grouped by Employee. The Detail
section includes the Subreport, which shows the activity of that
client within its own current business year. The Subreport footer
counts the line entries and totals a numeric field. The Subreport can
contain from ZERO line items to about 50 items.

I transferred the Count and Sum to the main report. I first tried
just using a fully qualified reference to the count and sum fields on
the subreport. The problem is that the Subreport may contain ZERO
line items and this causes the Count and Sum fields I transferred to
the main report to #ERROR.

I solved this, using a technique from the MS Knowledgebase:

=IIf([New Report #1 SubReport].[Report].[HasData]=True,[Report]![New
Report #1 SubReport]![ItemCount],0)

So now, the per-client count field and the total field on the main
report work correctly, even if the Subreport has no data. Everything
works to this point now.

But I also need to process the Cound and Total of all Clients by
Employee (the grouping level) and also as a Grand Total and Count for
the entire report.

I can't do the usual thing of just summing up the underlying data, as
it is on a Subreport and, again, because it #ERRORs out if the
Subreport is empty.

And I can't sum up the calculated field that I placed on the main
report (using the expression above).

QUESTION:

How do I get my Group Totals and Grand Totals in this situation?



Add an invisible(?) text box named txtRunGrpTotal to the
section with the subreport and set its controls source
expression to the text box with the subreport total. Then
set it's RunningSum property to Over Group.

The group footer can display the total by using the
expression =txtRunGrpTotal

You can use a similar arrangement to show a grand total in
the report footer.
--
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Label SRIT General Discussion 2 June 22nd, 2004 09:42 PM
Report and Subreport bdehning General Discussion 5 June 18th, 2004 04:55 PM
report print problems Joanne Buss Setting Up & Running Reports 0 June 9th, 2004 06:52 PM
Edit recipient list causes "cannot find its data source" in Word 2002. Les Mercer Mailmerge 3 May 7th, 2004 03:49 PM
SLOPE/INTERCEPT problems with missing data Trancemission Worksheet Functions 3 December 12th, 2003 12:38 PM


All times are GMT +1. The time now is 08:47 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.