TEXT TO mqry noshow BEGIN TRANSACTION SELECT * FROM stop1 WITH (tablockx) ENDTEXT SQLExec(m.con,mqry) Error_found=.f. && variable to detect error TEXT TO m.cmd NOSHOW INSERT INTO cash_sumt(vou_no,date) values(?thisform.text1.value, ?Thisform.text3.value) ENDTEXT If SQLExec(m.con,cmd)<0 Aerror(laerror) Messagebox(laerror[1,2]) Error_found =.T. Endif If Error_found =.F. && No error found TEXT TO mqry noshow commit transaction ENDTEXT SQLExec(m.con,mqry) Messagebox("Invoice Saved",0+64,"System",3000) Else && how to use rollback here if error found EndifPlease help me how to use Rollback if any error comes.