>*orders.dbf ->opened by dataenvironment >if param.cstat=1 &&save statistics >*check statistics file > cfi=alltrim(param.ordstatfile) > if file(cfi) > use (cfi) in 0 alias est_orders > endif >endif >cursorsetprop("Buffering",5,"orders") >sele orders >replace dmodi with date(), usmod with suser(), .... >if used("est_orders") &&apply statistics > cursorsetprop("buffering",5,"est_orders") ** BTW, note, that you're inserting into Statistics, not into Est_Orders > insert into statistics (nord,date,....) values(num_ord,date(),....) >endif llError = .f. >begin transaction >if tableupdate(1,.T.,"orders") > if used("est_orders") > if tableupdate(1,.t.,"est_orders") > end transaction > else > rollback > =tablerevert(.T.,"est_orders") =tablerevert(.t.,'Orders') > messageb("Statistics can't be saved",16,"Error") > endif else && The est-orders is not used, save anyway? end transaction > endif >else > rollback > =tablerevert(.T.,"orders") > messageb("Orders can't be saved",16,"Error") >endif >See the changes I made. Why did you open and close transaction? You need to open transaction, save changes in both tables and then close it.