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!

Conversion of a parm into 'Any' 1

Status
Not open for further replies.

Nansat

Programmer
Jun 22, 2006
29
US
Is there any possibility to convert a user input parameter to ANY?

Scenario :
user can pick one/many products from the product list available as a input parameter.

if user selects 000 (not a valid product, but instead our own code that represents 'All products') , then by using any formula can we make 'select expert' understand that USER wants 'All products' information ??
 
Hi,
Sure:
Code:
If {?Param} = '000' then
True
else
{table.productid} = {?Param}



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi Turkbear,

Thank you very much for the suggestion.

Also, can we have make a parameter 'OPTIONAL' by setting any parameter?.

Thanks
 
Hi,
Yes..

Set a default value for the parameter and test for it first ( same logic as testing for '000')..
If the parameter has no default value and none is supplied by user-interaction you must test for Null FIRST:
Code:
If 
( IsNull({?Param}) or Trim({?Param}) = "" or {?Param} = 'DefaultValue')
Then
True
Else
{table.Field} = {?Param}

If more than one parameter needs to be handled this way, enclose EACH 'If..Then..else' set in Parens and and/or them as needed to meet you needs..





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thank you very much Turkbear. I got around this problem in similar lines suggested by you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top