This is a fine idea and should be workable. Though it will require changing codes in similar functions. Thanks for a great Idea.
>Try this
>select * from mydbf where mydbf.myfield=myid into cursor mc
>sele mc
>scan
> select myotherdbf and do stuff
> select mydbf
> seek mc.keyfield
> if found()
> delete
> endif
> sele mc
>endscan
>if you are working with large numbers of records this should be faster. What I believe is happening with your code is that once you delete the current record the while condition is no longer met and the program drops out of the loop.
>SCAN WHILE myDBF.myField = myID
>>>>> SELECT myOtherDBF
>>>>> *** myOtherDBF manipulation logic goes here
>>>>>
>>>>> SELECT myDBF
>>>>> DELETE
>>>>> ENDSCAN