See message #
295799>>>Matt,
>>>
>>>I've found this approach a real pain. I've decided to run a timer instead. The calculation will be only activated if the user stops for a while.
>>>In fact I use a methof of the grid to decide if the recordpointer is moved (Using AFTERROWCOLCHANGE but only from VFP 7 (you missed to enter your version))
>>>This (re) starts a timer. The timer event will do the calculation. I use thus for refreshes I need too.
>>
>>Shouldn't changing the value of any of the fields which influence the total actually trigger the calculation? IOW, moving up and down a row doesn't change the total; changing numbers does.
>
>I guess I've just always taken the shotgun approach and forced the re-calc with every row or column change, as a catch-all approach. Rather than looking for number changes (where? in the Valid() or LostFocus() of each textbox in the colum? Having to store the initial value and do a compare in valid or lostfocus) or, if a row gets deleted. The later method just adds a lot of extra code and complexity, but, yes, perhaps at the cost of speed.
If it's not broken, fix it until it is.
My Blog