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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resetting Shared variable to Zero 2

Status
Not open for further replies.

johnugly

Programmer
Jun 21, 2004
31
BE
I have a main report with a subreport in it. The selection is by company. The subreport is passing a subtotal from a group to the main report. The report runs fine when there is data in the subreport. The problem I have is that when I do my selection of more than one company on the main report, then when the subreport does not have a subtotal for a particular company because there was no activity, then my main report keeps and displays the subtotal from the PREVIOUS company. How do I make this field to reset to zero when there is no data in the subreport.????

 
Create a formula in the main report:

whileprintingrecords;
shared numbervar subtot := 0;

Substitute your variable name for "subtot". Place this in the group header where you want the reset.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top