The solution turns out to be a combination of the suggestions from Troy and Mike. 
Thanks, all. 

Mike, with all the calulations in the form variable list, it still only calculated in 
one direction, so I had to take the calculations into eeps. These three eeps run, the 
last variables in the form list are. In order to display existing values for editing, 
I have to load the values to all four variables on entry to the form.

P_P_Qty INT = .fLB
P_P_KG INT = .fKG

Three eeps in the form.
  -- POTran1.eep
  -- Albert Berry 06/2003
  -- FORM: POTran
  -- Gets table values for P_P_Qty and P_P_KG on entry to form for later
  -- comparison/conversion. See POTran2.eep, POTran3.eep
  -- The sums will return a zero if the transaction is just being entered.
  SET VAR fTableLB INTEGER
  SET VAR fTableKG INTEGER
  SET VAR fLB INTEGER
  SET VAR fKG INTEGER

  SELECT SUM(P_P_Qty), SUM(P_P_KG),SUM(P_P_Qty), SUM(P_P_KG) +
    INTO fTableLB, fTableKG, fLB, fKG +
    FROM POTrans WHERE POTran = .fPOTran
  RECALC VAR  
  RETURN

  -- POTran2.eep
  -- FORM POTran, FIELD P_P_Qty on Exit
  -- Albert Berry 06/2003
  SET VAR fTableLB INTEGER -- Values are set on entry to row by POTran1.eep
  SET VAR fTableKG INTEGER
  SET VAR fKG INTEGER      -- Values are set in the form by variables
  SET VAR fLB INTEGER
  IF fLB <> .fTableLB THEN
      SET VAR fKG = (BRND(.fLB/2.20462,10,1))
  ENDIF
  RECALC VAR
  RETURN

-- POTran3.eep
  -- FORM POTran, FIELD P_P_KG on Exit
  -- Albert Berry 06/2003
  SET VAR fTableLB INTEGER -- Values are set on entry to row by POTran1.eep
  SET VAR fTableKG INTEGER
  SET VAR fKG INTEGER      -- Values are set in the form by variables
  SET VAR fLB INTEGER
  IF fKG <> .fTableKG THEN
      SET VAR fLB = (BRND(.fKG*2.20462,10,1))
  ENDIF
  RECALC VAR
  RETURN
  


__________________________________________________________________
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455

Reply via email to