Total of Sub-report at the footer of Main Report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I need to have a Total of my controls on sub-report at the location of
footer of Main report. I tried hard, but any reference to sub-report is shown
as error.
Could anyone help me to make it??
thanks
 
Leo said:
I need to have a Total of my controls on sub-report at the location of
footer of Main report. I tried hard, but any reference to sub-report is shown
as error.


A common thing to do. Maybe your reference is incorrect?

It should look something like:

=subreportcontrol.REPORT.subreporttextbox
 
Thanks,
I always use expression-builder, and it gives me the same reference as
yours. it works without SUM function, and gives me the first record of
sub-report value.
but when I use SUM(Reference...), then at running the report it asks me for
the value reference I gave it. actually it treats like a parameter query!
what is wrong!??
 
Leo said:
I always use expression-builder, and it gives me the same reference as
yours. it works without SUM function, and gives me the first record of
sub-report value.
but when I use SUM(Reference...), then at running the report it asks me for
the value reference I gave it. actually it treats like a parameter query!
what is wrong!??

Where is the Sum expression? It almost sounds like you have
it in the main report, it needs to be in the subreport's
Report Footer section.

If it is in the subreport's footer section, then I'll guess
that the Sum is referring to another text box in the
subreport, it must refer to a field in the subreport's
RecordSource table/query.
 
Thanks for the reply.
I managed to do that at last by this little trick.
Created an invisible textbox in sub-report for total of the sub-report
(textbox1), and a visible textbox in main report's footer(textbox2). then
created a public function by VB which returns the value of the textbox1. I
assigned the textbox2 value equal to this function.
So everytime the report is run, the textbox2 shows whatever is in textbox1
which is the same of total of subreport. the problem is that Access Sum
function can only communicate with the controls or references within the
report not outside the report, but a VBA code can.
best regard...
 
Back
Top