Hello Dennis,
>IF MESSAGEBOX(lcMessage,C_MSGBOX1) = MSGBOX_YES
>BEGIN TRANSACTION
>SELECT INVOICE
>DELETE
>IF !EOF()
>SKIP 1
>ENDIF
>IF EOF() AND !BOF()
>SKIP -1
>ENDIF
>SELECT IDETAIL
>DELETE FOR invno = lcInvNo
>END TRANSACTION
>THISFORM.Refresh
>ENDIF
Perhaps, you should try to delete Detail lines at first then delete invoice
line
BEGIN TRANSACTION
SELECT idetail
DELETE all FOR invno = lcInvNo
IF !EOF()
SKIP 1
ENDIF
IF EOF() AND !BOF()
SKIP -1
ENDIF
SELECT invoice
delete
END TRANSACTION
THISFORM.Refresh
But better way is to have Delete trigger for Idetail table (so, whenever you'll
delete a record from invoice table, you'll also delete all related records from
IDETAIL table)
* Human is a question asked by birth and answered by death. Machine is another kind of question with another kind of answer