Crystal shared var printing previous record

SOLVED

I am passing a value from a subreport to main report and in the main report this is the formula: 

WhilePrintingRecords;
shared numbervar Cafe; Cafe

If there is not a match between the main report and subreport, Then it prints the value from the previous record. 

All sections of the subreport are suppressed and the subreport is in the section above the section where the formula is in the main report. Is there something I should add like "isnull"?

Looking for suggestions to remedy. Thanks!

Sage 100 v2019 Premium CRW 2016

Parents Reply
  • 0 in reply to Kevin M

    To follow up on Kevin's suggestion, do something like this in the section above your subreport.  Add the formula (call it reset cafe) and drop it in the section above your subreport.  You can suppress the reset cafe formula so it doesn't print, but the formula has to be on the report's design,

    WhilePrintingRecords;
    shared numbervar Cafe

    Cafe := 0

Children