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  

Sub-Report Totalling



 
 
Thread Tools Display Modes
  #1  
Old July 19th, 2004, 02:41 PM
Howard
external usenet poster
 
Posts: n/a
Default Sub-Report Totalling

I was given great advise to achieve the results I needed
by dragging a sub-report into a report ... didn't know I
could do that ... worked great! Now I'm trying to grand
total a sub-report field into a report footer field in the
main report. I used the sum function but it doesn't seem
to recognize the field in the sub-report. Is that because
the main report is not bound to the same query as the sub-
report? How can I overcome this? Please let me know.
Thanks!
-Howard
  #2  
Old July 19th, 2004, 04:21 PM
Marshall Barton
external usenet poster
 
Posts: n/a
Default Sub-Report Totalling

Howard wrote:

I was given great advise to achieve the results I needed
by dragging a sub-report into a report ... didn't know I
could do that ... worked great! Now I'm trying to grand
total a sub-report field into a report footer field in the
main report. I used the sum function but it doesn't seem
to recognize the field in the sub-report. Is that because
the main report is not bound to the same query as the sub-
report?


You're right. Sum only operates on fields in the record
source table/query.

A main report can retrieve values from its subreports'
controls in the subreport's header/footer sections. The
syntax to do this in a main report text box named
txtRunTotal is:
=subreportcontrol.Report.textbox
or if there's a chance that there may not be any records in
an instance of the subreport:
=IIf(subreportcontrol.Report.HasData,
subreportcontrol.Report.textbox, 0)

To total those values, set the txtRunTotal text box's
RunningSum property to Over All. Then the main report's
footer's text box can display the total using the
expression:
=txtRunTotal
--
Marsh
MVP [MS Access]
  #3  
Old July 19th, 2004, 04:49 PM
Howard
external usenet poster
 
Posts: n/a
Default Sub-Report Totalling

Thanks ... I'll give it a try!

-----Original Message-----
Howard wrote:

I was given great advise to achieve the results I needed
by dragging a sub-report into a report ... didn't know I
could do that ... worked great! Now I'm trying to grand
total a sub-report field into a report footer field in

the
main report. I used the sum function but it doesn't seem
to recognize the field in the sub-report. Is that

because
the main report is not bound to the same query as the

sub-
report?


You're right. Sum only operates on fields in the record
source table/query.

A main report can retrieve values from its subreports'
controls in the subreport's header/footer sections. The
syntax to do this in a main report text box named
txtRunTotal is:
=subreportcontrol.Report.textbox
or if there's a chance that there may not be any records

in
an instance of the subreport:
=IIf(subreportcontrol.Report.HasData,
subreportcontrol.Report.textbox, 0)

To total those values, set the txtRunTotal text box's
RunningSum property to Over All. Then the main report's
footer's text box can display the total using the
expression:
=txtRunTotal
--
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
Restrict Report To Current Record Katherine R Setting Up & Running Reports 1 July 15th, 2004 07:23 PM
Restrict Report to Current Record Katherine R Setting Up & Running Reports 1 July 15th, 2004 07:23 PM
Specify Filter criteria before running report Nikos Yannacopoulos Setting Up & Running Reports 3 June 25th, 2004 09:36 PM
Problems totalling subreport data on main report (A-2002) Marshall Barton Setting Up & Running Reports 0 June 23rd, 2004 08:01 PM
Label SRIT General Discussion 2 June 22nd, 2004 09:42 PM


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