Getting a total from a subreport

G

Guest

I have a subreport in my main report. The report is in a footer that is
called RT Footer. In the RT Header of my main report, I have the following
in a text box: =Reports!rptCOMMISSION_REPORT.rptCREDIT.Report!tEXT28. This
textbox is supposed to give me the total for the linked RT in the
master/child relationship. However, for the first record in my main report,
I do get the correct total, but for the next record and so on, in my main
report, I get the previous records total. So, record 1 in the main report, I
get the total for record 1 in the subreport; record 2 in the main report, I
get the total for record 1 in the subreport; record 3 in the main report, I
get the total for record 2 in the subreport, and so on.

The two reports are linked correctly but I can't figure out what I've done.
I moved the text box from the RT Header to the RT Footer to see what it would
do and it started giving me the correct results.

Is there something that I can do to get this to report correctly. Thanks in
advance.
 
M

Marshall Barton

Don said:
I have a subreport in my main report. The report is in a footer that is
called RT Footer. In the RT Header of my main report, I have the following
in a text box: =Reports!rptCOMMISSION_REPORT.rptCREDIT.Report!tEXT28. This
textbox is supposed to give me the total for the linked RT in the
master/child relationship. However, for the first record in my main report,
I do get the correct total, but for the next record and so on, in my main
report, I get the previous records total. So, record 1 in the main report, I
get the total for record 1 in the subreport; record 2 in the main report, I
get the total for record 1 in the subreport; record 3 in the main report, I
get the total for record 2 in the subreport, and so on.

The two reports are linked correctly but I can't figure out what I've done.
I moved the text box from the RT Header to the RT Footer to see what it would
do and it started giving me the correct results.

Is there something that I can do to get this to report correctly. Thanks in
advance.


I don't see how you got the correct result in the first
record. The problem is that you are trying to display a
value that will not be calculated until later in the report.
After the first line, the value exists, but from the
previous line so that is what is used.

You should either live with the value in the footer or
change the report to use a query that includes calculations
for the data in the subreport. That could be just a Totals
type subquery or something more complex depending on the
complexity of the subreport calculation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top