CLOSE all lcTable1 = alltrim(thisform.text5.value) lcTable2 = alltrim(thisform.text6.value) lcBillValue = &lcTable1..bill_value && Note you must use double periods here Use ( lcTable1) in 0 Use ( lcTable2) in 0 lcField = alltrim(thisform.text1.value) replace IN &lcTable2..somefield ; && Note the macro and double periods FOR EVAL(lcField)==LookUp(lcTable1.&lcfield), EVAL(lcField), (lcTable1.&lcfield)) AND NOT EOF('lcTable1'); NEWVALUE with VAL(lcBillValue)