Connecting Tech Pros Worldwide Help | Site Map

Pass Running-sum Group Total from Sub Report to Main Report

Pecanfan
Guest
 
Posts: n/a
#1: Nov 13 '05
Hi,

I've got an access report which contains a sub-report. The sub-report
contains various items in a group Footer which culminates in a running sum
text box called txtGrandTotal. I want to use this 'total' in the main
report so I have a text box with the following:-

=([Reports]![RPT_MainReport]![RPT_SubReport].[Report]![txtGrandTotal])

For some reason, which I'm sure is perfectly obvious but I'm buggered if I
can think why, the above doesn't actually show the grand total. Instead it
shows the value of the first record in the sub-report's group footer. I.e.

txtGrandTotal in RPT_SubReport shows the CORRECT value

[Reports]![RPT_MainReport]![RPT_SubReport].[Report]![txtGrandTotal] shows
the INCORRECT value


What am I missing?!?

TIA,

Andy


Allen Browne
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Pass Running-sum Group Total from Sub Report to Main Report


A *running sum* text box in the subreport? Hmm. That's probably a timing
issue, i.e. at the time the main report reads the value from the subreport,
only the first record has been accessed.

Is there any chance of placing a text box in a group footer in the
subreport, and setting its ControlSource to:
=Sum([SomeField])
so that this box is dependent on all the others, and so Access can get the
total only after it is completed?

(You can set the Visible property of the text box or even the group footer
section to No if you don't want it shown.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Pecanfan" <pecanfan@no.spam> wrote in message
news:1120228451.548535@smtp-1.griffin.com...[color=blue]
>
> I've got an access report which contains a sub-report. The sub-report
> contains various items in a group Footer which culminates in a running sum
> text box called txtGrandTotal. I want to use this 'total' in the main
> report so I have a text box with the following:-
>
> =([Reports]![RPT_MainReport]![RPT_SubReport].[Report]![txtGrandTotal])
>
> For some reason, which I'm sure is perfectly obvious but I'm buggered if I
> can think why, the above doesn't actually show the grand total. Instead
> it
> shows the value of the first record in the sub-report's group footer.
> I.e.
>
> txtGrandTotal in RPT_SubReport shows the CORRECT value
>
> [Reports]![RPT_MainReport]![RPT_SubReport].[Report]![txtGrandTotal] shows
> the INCORRECT value
>
>
> What am I missing?!?
>
> TIA,
>
> Andy[/color]


Pecanfan
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Pass Running-sum Group Total from Sub Report to Main Report


> Is there any chance of placing a text box in a group footer in the[color=blue]
> subreport, and setting its ControlSource to:
> =Sum([SomeField])
> so that this box is dependent on all the others, and so Access can get the
> total only after it is completed?[/color]

Do you mean create *any* Sum field in the group footer - i.e.
=Sum([Anything]) ? If so I've already got a summing field in the group
footer (the whole shebang is in the group footer) - I don't have anything in
the Detail of the subreport at all - is that bad?

Cheers,

Andy


Pecanfan
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Pass Running-sum Group Total from Sub Report to Main Report


> > Is there any chance of placing a text box in a group footer in the[color=blue][color=green]
> > subreport, and setting its ControlSource to:
> > =Sum([SomeField])
> > so that this box is dependent on all the others, and so Access can get[/color][/color]
the[color=blue][color=green]
> > total only after it is completed?[/color]
>
> Do you mean create *any* Sum field in the group footer - i.e.
> =Sum([Anything]) ? If so I've already got a summing field in the group
> footer (the whole shebang is in the group footer) - I don't have anything[/color]
in[color=blue]
> the Detail of the subreport at all - is that bad?[/color]

Oh, Access... how I love it. Gave up and created another utterly pointless
subreport and copied all the 'summary' stuff I wanted in the main report
into this sub report - then inserted this subreport back into the main
report. That works!

Gah! :-)

Andy


Closed Thread