David:
I would restructure it to something like the following (I'm assuming you want the whole transaction to fail if one update fails):
LOCAL llSuccess
llSuccess = .T.
BEGIN TRANSACTION
FOR EACH lcTableNumber IN THISFORM.latables
IF .NOT. TABLEUPDATE(.T.,.T.,lcTableNumber)
ROLLBACK
llSuccess = .F.
EXIT
ENDIF
IF llSuccess
END TRANSACTION
ENDIF
NEXT
FOR EACH lcTableNumber IN THISFORM.latables
TABLEREVERT(.T.,.T.,lcTableNumber)
NEXT
As for the deleted problem: is SET DELETED ON? (Keep in mind SET DELETED is scoped to the current data session.)
>He guys,
>First i want your honest opinion about my delete routine in my
>delete method, i recently started to put transactions in my
>applications and i don't know much about them so.
>
>second
>I have problems when i delete the record and i do a refresh
>of the form the you still see the record on the form.
>
>
>begin transaction
>for each lctablennumber in thisform.latables
>select (lctablenumber)
>if tableupdate(.t.,.t.)
>else
>messagebox("Table can not be updated")
>" , 16 , "failure...")
>rollback
>exit
>endif
>endfor
>end transaction
>endif
>thisform.refresh
>
>Thanks for your opinion
>david