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!

Shared Variable not passing correctly

Status
Not open for further replies.

VE

Technical User
Oct 25, 2000
220
US

Hi,

When there is only one record in a group in the sub report, I need it to give me a dummy date of 01/01/1900. if there are more than one date records I need it to give me the previous date record.

This is the formula in my sub report:

whileprintingrecords;
if Count ({DRLDCH01.CHCODT}, {DRLDCH01.CHDACN}) = 1 then #01/01/1900# else
if {DRLDCH01.CHDACN} = previous({DRLDCH01.CHDACN}) then
shared datevar PreviousContactDate:=
previous({DRLDCH01.CHCODT}) else #01/01/1900#

It works in the sub report, if I drill down from the main report it gives the correct data.

The sub report is linked to the main report by the {DRLDCH01.CHDACN} field.

This is the formula in the main report

whileprintingrecords;
shared datevar PreviousContactDate

When that formula prints on the main report, instead of giving me 01/01/1900 when it does in the sub report, it gives me the last date from the previous {DRLDCH01.CHDACN} record for all records.

It all works fine if the sub report has more than one record for {DRLDCH01.CHDACN}

I'm hoping I have just been staring at this too long and the answer is obvious :)

Thank you in advance for your help

VE
 

OK I figured it out. I forgot to reset the variable.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top