Hello, everyone. I have a text box in my main report which acquires its value from a sum in the subreport footer. However, the value it returns is for the next record/page of the main report instead of the current record. Can anyone please assist?
What is the control source of the text box?
What are the master child fields for the subreport?
Is the subreport in the detail section or which section is it in?
If the sub report is not in the detail section, what if any grouping do you have?
The purpose of the report is to produce telephone service invoices for residents of a retirement home. The subreport details the resident's long distance calls and provides a sum of the costs of each call. This is the control for the text box in the main report (=numCallCostSum). The master/child fields are the same for both - the resident telephone number (10 digits, text format). The subreport is in the detail section.
In essence, what's happening is that the sum of call costs for the first resident are showing up in the second resident main report, rather than the resident's own total. In the subreport itself, the sum is working properly.
I can get the totals from a nested query within the query that the main report is based on but I thought it would be more efficient (and possibly faster) to use the calculation from the subreport. If you need more information, please let me know - I would very much like to know how to do this without the nested query, if for nothing else other than my peace of mind.
Sounds like it should work...
Can you just display the total in the subreport? I'd make the control visible in the subreport to verify that the two values are different.
Does the sub report have any grouping? I'd group by the telephone number and put the sum control (numCallCostSum)in the telephone number footer.
If you still don't have any luck, you could try changing the criteria of your query of the subreport to look at the phone number in the main report.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.