text TO m.cmd NOSHOW TEXTMERGE begin transaction && First Command delete from crpr_sum where date=?Thisform.text3.Value and vou_no=?Thisform.text1.Value && Second Command select MAX(vou_no)as max_sno from crpr_sum where date=?thisform.text3.Value" && Result of second command thisform.text1.value=nvl(max_sno,0)+1 && Third Command INSERT INTO crpr_sum( vou_no,date,vou_type,acc_code,acc_name,sales_r,vehicle_no,bilty_no,tpt, driver,cr_amount,dr_amount) values( ?Thisform.text1.Value,?thisform.text3.value,'PR',?thisform.text10.value, ?thisform.text11.value,?thisform.text13.value,?thisform.text14.value, ?thisform.text15.value,?thisform.text16.value,?thisform.text2.value, ?thisform.text22.value,0) ENDTEXT if sqlcommit(m.con)<0 aerror(laerror) messagebox(laerror[1,2]) rollback else end transaction endif endif endtext