Gary,
You don't mention what version of VFP you are using. You may be able to greatly simplify your code by starting to think in "set" terms.
select ParentKey, sum( x ) as TotalX
from B
into cursor Total
group by ParentKey
So in one command execution you have totaled all of the transactions.
Database normalization rules would tell you though that in general these total values should not be stored in the parent table rows. One reason is the first time a row is added, deleted or updated in the child table you've invalidated the value stored on the parent row.
There are times where you want to keep rolled up information, but they should be specialized fact/reporting tables not your actual transaction tables.
>Sorry if I was vague. I have a parent table , A, which holds summarized values of transaction table, B.
>
>I scan through table A and sum all the records matching A.value. Then I store that sum qty in table A. Go to the next record in table A and then again scan table B matching A.value.
>
>The code runs with out errors, it just seems to skip records.
>When I substitute Do While - EnndDo for the Scan - EndScan, it works as I expect.