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