Okay, I beleieve I have fixed it. All the time my code was performing exactly wha I had asked of it. The issue was, the cusror was not updated when the accumulation method queried it. I soleved the problem with one statement in the click event of the checkbox:
The checkbox is bound to the field "Selected" in the cursor that populates the grid.
When I unbound the checkbox, I found it would maintain its last state when refreshing the grid with a new cursor. IOW, when repopulating the grid with new values, if from the previous cursor the check box was 'clicked', then all the new checkboxes would also be clicked.
Re-binding the control seems to eleveate that issue.
In the Click method of the checkbox:
* click
LOCAL lcInvoiceNumber, llSelected
WITH THIS
m.llSelected = .VALUE
m.lcInvoiceNumber = csrGLAR.INumber
UPDATE csrGLAR ;
SET ISelected = IIF(llSelected, .T., .F.) ;
WHERE INumber = lcInvoiceNumber
ENDWITH
RETURN
Then, as you suggested, I perform the accumulation routine from the valid event of the check box.
It seems to work exactly as I desire.
Well, okay. One command and a few supporting statements.
Thank you for your concise advise,
Gary De Lecce
Driving toward a Tactical Edge