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

Shared Variable Returning the Same Number 1

Status
Not open for further replies.

Ohioste

Technical User
Apr 21, 2009
58
US
I'm having a problem with a shared variable that returns the same data in the main report. I have it sorted and linked by a SKU, but some data does not exist in the sub report that's in the main report.

If the SKU does not exist in both reports, it will return the data from the last SKU that is in both reports.

I just want to be able to return a 0 for something that is in the main report, but not in the subreport.

Your help is appreciated!
 
Reset the var back to zero at an appropriate point above the Subreport.

@reset
whileprintingrecords;

Global numbervar yourvar:=0;

Ian
 
Wonderful!

Thank you so much. It's the easy stuff like this that makes me realize I still have so much to learn!
 
Just to clarify for any other readers, the reset formula should be:

//{@reset}:
whileprintingrecords;
shared numbervar yourvar := 0;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top