WITH ThisForm SELECT WORK SCAN && FOR WORK.Order_Num = tmpOrders.Order_num SELECT BatchN lcOrderNo =Work.Order_Num lcPart_Num=Work.Part_Num *SELECT BATCHN IF !SEEK(lcOrderNo) && 1st time in to the BATCHN table.. * If there is no record yet, make a new one. APPEND BLANK * Put in the data for the first line item.