How are you checking that no inserts happen? In your code it looks like you're inserting records into two different tables (or is it the same table?), one of them is probably unopened before.
Anyway, by the quick glance I don't see why the records would not be inserted. Unless there is an error, which is somehow not reported correctly.
>Thank you Naomi.
>Please see two inserts during one pass of the scan:
>
>
>SELECT vBackgroundSubjectBilling_fk
>
>SCAN FOR UPPER(ALLTRIM(vBackgroundSubjectBilling_fk.BSB_Status)) == "REQUEST FOR BILL"
>
> *
> * insert record into the export table file
> *
> lcBSB_Reason = LEFT(lcBSB_Reason, 50)
>
> INSERT INTO (ADDBS(this.icWorkingDirectory) + "BillFile.dbf") (coid, clnum, pcdate, intotbill, deid, indesc, inglnum1, ;
> inglamt1, inglnum2, inglamt2, Inmeth, stid, xfer, lgname, adddte, addtime, xxo_id, xxo_prefix, xxo_ref) ;
> VALUES (lnCoid, lnCLNum, vBackgroundSubjectBilling_fk.BSB_IncurDate, vBackgroundSubjectBilling_fk.BSB_Cost, SPACE(0), ;
> lcBSB_Reason , 0, 0, 0, 0, "BSO", SPACE(0), .F., oUser.GetUserInfo("USR_LANID"), DATE(), TIME(), ;
> vBackgroundSubject_de.BSO_ID, "BSO", SPACE(0))
>
> this.inBillFileSum = this.inBillFileSum + vBackgroundSubjectBilling_fk.BSB_Cost
> this.inBillFileRowTotal = this.inBillFileRowTotal + 1
>
> *
> * insert a credit record into the export table file
> *
> INSERT INTO BillFile (coid, clnum, pcdate, intotbill, deid, indesc, inglnum1, ;
> inglamt1, inglnum2, inglamt2, Inmeth, stid, xfer, lgname, adddte, addtime, xxo_id, xxo_prefix, xxo_ref) ;
> VALUES (lnCoid, lnCLNum, vBackgroundSubjectBilling_fk.BSB_IncurDate, -vBackgroundSubjectBilling_fk.BSB_Cost, SPACE(0), ;
> lcBSB_ReasonCredit , 0, 0, 0, 0, "BSO", SPACE(0), .F., oUser.GetUserInfo("USR_LANID"), DATE(), TIME(), ;
> vBackgroundSubject_de.BSO_ID, "BSO", SPACE(0))
>
> this.inBillFileSum = this.inBillFileSum - vBackgroundSubjectBilling_fk.BSB_Cost
> this.inBillFileRowTotal = this.inBillFileRowTotal + 1
> *
> * advance BSB_Status to billed
> *
> llSuccess = this.oBiz.SetBillingStatus("Billed")
>
>ENDSCAN
If it's not broken, fix it until it is.
My Blog