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

Shared Variable Problem

Status
Not open for further replies.

Memento

MIS
Jun 19, 2005
46
US
CR8.5

I have a shared variable returned from a subreport to the main report that's not returning correctly. I have the subreport linked to the main report by ClientID. I have a True/False Shared Varible I want returned from the subreport to the main report.

The subreport "IS" above the shared variable.

Problem:
The data seems to be all or nothing. If one of the records Grouped by staff on the main report meets the criteria, then it Returns all the Cleint records as TRUE. If none of the records meet the condition, it comes up blank.

Subreport Formulas:
@FlagCount
If {?Pm-clientstb.cl_id}={clientstb.cl_id} then True Else False

@SubIsActive
WhilePrintingRecords;
Shared BooleanVar MyFlag:={@FlagCount}

Main Report Formula:
@MainIsActive
WhilePrintingRecords;
Shared BooleanVar MyFlag;
MyFlag

Groups
Staff
ClientID A
ClientID B
Detail

I have the subreport in ClientID A, and the @MainIsActive in Group ClientID B.
 
I found the solution after searching through tons of threads. I eventually found a post from Lbass.

It reads:
Lbass
"You need a reset formula in the main report, as in:

Whileprintingrecords;
shared CurrencyVar TotSIQM := 0;

Place this in a section above the one in which the subreport is executing, e.g., in GH#1a if the subreport is in GH#1b. Or you can place it in the report header AND in a group footer section after the subreport executes."

I inserted a reset value into my report and now it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top