The AcceptText() in ItemChanged event can cause problems if an item error occurs... I think from memory. Not good practice regardless. The reason why some people put it there is to ensure that regardless of what column is changed the "data" is in the buffer.
BUT ACCEPTTEXT() TRIGGERS ITEMCHANGED() and some older versions are still looping as a result....
Except for the AcceptText(), move the whole script the new ue_recalculate event
In the ItemChanged() event:
this.EVENT POST ue_recalculate ( row )
Where you retrieve:
long ll_row
dw_1.retrieve ( ...
for ll_row = 1 to dw_1.RowCount()
dw_1.EVENT ue_recalculate ( ll_row ) // no need to post
next
CloseQuery event:
long ll_row
if dw_1.AcceptText() < 0 return 1
for ll_row = 1 to dw_1.RowCount()
dw_1.EVENT ue_recalculate ( ll_row ) // do not post
next
dw_1.Updat.....