Dan,
One thing I found out (the hard way) is that if you have some certain
characters -such as a single quote in O'Malley- in your selected list, it
will not work properly.
This is the code that I use:
-------------------------------
CHOOSE vemp_code FROM #VALUES for +
DISTINCT (LJS(emp_sname,22) + LJS(slot_no,10)), +
(''''+ slot_no +'''') FROM emp_file CHKBOX 30 +
TITLE 'Available Employees' CAPTION 'Select Up to 30 Employees...' +
LINES 8 +
OPTION Themename &vUser_Theme
SET VAR vemp_code = ('(' + .vemp_code + ')')
COMPUTE vcount AS COUNT fwo_no FROM fwo_labor_view WHERE fwo_stat = 'O' +
AND slot_no IN &vemp_code
-- Other Code
RETURN
-------------------------------
You will notice that the return columns format:
(''''+ slot_no +'''')
collects the selected items in the format:
'item1','item2','item3'.
Then, I place parentheses around the expression and I am good to go.
I got this tip from this List many years ago and have not had any problems
since then.
Javier,
Javier Valencia, PE
913-829-0888 Office
913-915-3137 Cell
913-649-2904 Fax
<mailto:[email protected]> [email protected]
_____
From: [email protected] [mailto:[email protected]] On Behalf Of Dan Goldberg
Sent: Friday, May 27, 2011 8:57 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: Using values from choose to select
That works!
Thanks
Dan
From: Walker, <mailto:[email protected]> Buddy
Sent: Friday, May 27, 2011 6:52 AM
To: RBASE-L Mailing List <mailto:[email protected]>
Subject: [RBASE-L] - RE: Using values from choose to select
Dan
You will have to use the ampersand (&) instead of the period
SET VAR vlist = ( '(' + .vlist + ')')
select all from partslist where partnumber in &vlist
Buddy
From: [email protected] [mailto:[email protected]] On Behalf Of Dan Goldberg
Sent: Friday, May 27, 2011 9:47 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Using values from choose to select
I have a choose command that uses the chkbox to select multiple part numbers
and stores it in a variable.
vlist = part1,part2,part3
I want to do a select command displaying the selected parts.
I tried this:
select all from partslist where partnumber in (.vlist)
I know I have done this before but is drawing a blank.
TIA
Dan Goldberg