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!

Display Parameter Values Error 1

Status
Not open for further replies.

jcmv007

Technical User
Nov 1, 2001
88
US
Using CRW 8.5.0.217

Hi want to display my parameter info in a report and took this formula off a post but am getting the follow error message:

"A number, currency amount, boolean, date, time, date-time, or string is required here."

And it points to this part of the code:
Code:
totext({?Familia}[i],0,"")


Parameter INFO:
Parameter name: {?Familia}
Value type: Number
Allow multiple values CHECKED
Discrete and Range Values CHECKED

The formula been used is the following.
[/code]Local NumberVar i := 1;
Local NumberVar loops := UBound({?Familia});
Local StringVar Display := "Selected: ";

For i := 1 to loops do
(
Display := Display & totext({?Familia},0,"") &" - " &
(if {?Familia} = 325 then "On Order"
else if {?Familia} = 326 then "In Stock") &
iif(i<loops, &quot;, &quot;, &quot;.&quot;)
);
Display;
[/code]
 
Nicely written formula and post!

What got you was selecting Discrete and Range Values, try the following (I also found some formatting concerns and cleaned it up):

Local NumberVar i := 1;
Local NumberVar loops := UBound({?Familia});
Local StringVar Display := &quot;Selected: &quot;;

For i := 1 to loops do
(
if minimum({?Familia}) = maximum({?Familia}) then
Display := Display & totext((minimum({?Familia})),0,&quot;&quot;) & (if minimum({?Familia}) = 325 then &quot;- On Order&quot;
else if minimum({?Familia}) = 326 then &quot;- In Stock&quot;) &
iif(i<loops, &quot;, &quot;, &quot;.&quot;)
else
Display := Display & totext((minimum({?Familia})),0,&quot;&quot;) & &quot; - &quot; & totext((maximum({?Familia})),0,&quot;&quot;) &
(if minimum({?Familia}) = 325 or maximum({?Familia}) = 325 then &quot;- On Order&quot;
else if minimum({?Familia}) = 326 or maximum({?Familia}) = 326 then &quot;- In Stock&quot;) &
iif(i<loops, &quot;, &quot;, &quot;.&quot;)
);
Display;

-k
 
synapsevampire

Thanks for the remark!

And the anwser worked great!

Have a Star.


James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top