try...


SET VAR vPartnew TEXT = NULL

 SET VAR vPartnew = Partrelate FROM PART_RELATE +

    WHERE Partnum = .vPartchoice



IF vPartnew is not null and vPartChoice =.vPartnew  THEN +

       SET VAR VFormMode = 'EDIT'

    EDIT USING KPRAssyPartGrid WHERE Assembly# = .vPartnew +

    ORDER BY PartNum

ELSE

    SET VAR VFormMode = 'EDIT'

    EDIT USING KPRAssyPartGrid WHERE Assembly# = (.vPartchoice) +

    ORDER BY PartNum

ENDIF

  ----- Original Message ----- 
  From: Jim Belisle 
  To: RBASE-L Mailing List 
  Sent: Monday, August 24, 2009 9:43 AM
  Subject: [RBASE-L] - [No Subject]


  I get an error for the below command 'Syntax is incorrect for the command IF'

  vPartChoice is defined prior to this statement and comes up correctly when I 
SHOW VAR.

  PART_RELATE is a table and the column names I am using are correct.

   

  SET VAR vPartnew TEXT = NULL

  IF vPartChoice = (SELECT Partnum FROM PART_RELATE) THEN +

      SET VAR vPartnew = Partrelate FROM PART_RELATE +

      WHERE Partnum = .vPartchoice

      SET VAR VFormMode = 'EDIT'

      EDIT USING KPRAssyPartGrid WHERE Assembly# = .vPartnew +

      ORDER BY PartNum

  ELSE

      SET VAR VFormMode = 'EDIT'

      EDIT USING KPRAssyPartGrid WHERE Assembly# = (.vPartchoice) +

      ORDER BY PartNum

  ENDIF

   

  Jim

   

Reply via email to