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

Pass Boolean Parameter to Sub Report

Status
Not open for further replies.

ChuckVanT

Programmer
Feb 7, 2003
17
US
I have a report that runs on a subset of manufacturers, based on a Boolean parameter field. Is there a way to pass the value to the record selection formula in a sub-report?

More simply, I guess....

Main Report:
IF {?DatedGoods} = True
THEN manufacturer in ["AAA","BBB","CCC"]

Sub-report has credits from a different table that requires a 5 table join (LONG story).

Based on the {?DatedGoods} parameter, I want the same manufacturers from the subreport (Manufacturer codes to be hard coded).


Thanks in advance & HAPPY Holidays to all!

Chuck
 
A possible solution would be to concatenate the manufacturers' codes into a single string, for example 'AAA#BBB#CCC', to pass the string as parameter to the subreport, and to use InStr function in subreport record selection formula, like

if InStr({?the_string_from_main_report}, {code_field})>0 then true else false

So if the {code_field} in subreport will be, for example 'BBB', the InStr returns 4 and the result of selection formula will be True.
A "code separator" character in the string should be one that is not used in manufacturer codes. In the example above we assumed that # is not used in the codes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top