Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

subreport to main report shared variable help

Status
Not open for further replies.

buzcut

Programmer
Dec 16, 2000
10
This may have been posted or answered previously, but I can't find the answer. I hope someone can help me here. I need to pass a running total based on a formula from a subreport to the main report. Problem is, all I get on the main report is 0.00. Works in the subreport just fine.
Here is the code:

On Subreport...
Running total rTOTPIPPMTS:
{ACCOUNTS.EntryType}=64
//sets to reset on change of patientId which is a group

gTOTPIP:
WhilePrintingRecords;
Shared CurrencyVar gTOTPIPPMTS;
gTOTPIPPMTS := {#rTOTPIPPMTS}

On MAIN report....
placed in the group footer:
WhilePrintingRecords;
Shared CurrencyVar gTOTPIPPMTS;
gTOTPIPPMTS

the subreport is placed in the group header of the main report.

I can't get the subreports' total to appear in the main report.
Any help?

Thanks!

Mister Ed
 
It looks like you have this set up correctly. Do you have a reset formula for the shared variable that you have not shown? If so, where did you place that? Also, what field are you grouping on in the main report? How is the subreport linked to the main report (if linked)?

Also, did you copy and paste the above formulas into this thread? You might want to double check that you are using "shared" in both places, and that the variable name is used consistently in all formulas.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top