Bob, have you tried creating a view for this? I use views for choose commands
all the time, with
the view containing exactly two columns. A view for employees for example would
be used as
follows:
SET VAR vCount INTEGER
SET VAR vChoice TEXT
SET VAR vEmpNo INTEGER
SELECT COUNT(*) INTO vCount +
FROM sys_tables +
WHERE sys_table_name = 'vwmEmployees'
IF vCount > 0 THEN
DROP VIEW vwmEmployees
ENDIF
CREATE TEMP VIEW vwmEmployees (Choice,EmpNo) AS +
SELECT (LJS.......),EmpNo FROM Employees +
WHERE someCol = someVar
-- then the choose box reduces to this:
CHOOSE vChoice FROM #VALUES FOR Choice,EmpNo FROM vwmEmployees
--- Bob Castanaro <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I am trying some experimenting with forms to take the place of a long pile
> of code that executes in a specific sequence.
>
> I have an extravagant choose command that has a few fields and a few
> calculations that is based on a view.
> I can easily run this in an eep, but I want to display this in a box on
> the form, that can change based on the value of a variable. Tried some of
> the variable list boxes and even a variable edit with expression. Nothing
> seems to give me the desired result.
> Here is the spaghetti....
>
> IF .VPROCTYPE = "PAIN MANAGEMENT" OR .VPROCTYPE = "WOUND MANAGEMENT" THEN
> CHOOSE VPROCDATE2 FROM #VALUES FOR +
> ((LJS(DOCTOR,16))+(LJS(OFFDAY,12))+(CTXT(PROCDATE))+"
> "+(CTXT(PROCOUNT))),PROCDATE +
> FROM COFFVIEW WHERE PROCTYPE = .VPROCTYPE AND DOCTOR = .VDOCTOR +
> ORDER BY DOCTOR PROCDATE +
> TITLE "Choose Schedule Date, [ESC] for New Date" +
> CAPTION "Scheduled days" +
> LINES 20 FORMATTED OPTION TITLE_FONT_COLOR BLUE|TITLE_BOLD ON
>
> Any suggetions for the experts out ther???
>
> TIA
> Bob C.
>
> BTW, I see Razzak is busy tonight with RC2. Heck of a way to spend Friday
> night!
>
Albert Berry
Management Consultant
RR2 - 1252 Ponderosa Drive
Sparwood BC, V0B 2G2
Canada
(250) 425-5806
(250) 425-7259
(708) 575-3952 (fax)
[EMAIL PROTECTED]