m.fila = recno() ... goto m.filaFor summing I suggest to do the whole sum once and then update the result from controls only that would affect the sum. You could keep a variable, an array or read&write cursor depending on your summed fieldcount and summed set.
* Sum child three fields per parent change + child update * Method summing at form entry - ie: form.init select linkfield, ; sum(field1) as sum1, ; sum(field2) as sum2, ; sum(field3) as sum3, ; from childtable ; group by 1 ; where .t. ; into cursor tcTemp use dbf("tcTemp") in 0 again alias tcTotals use in "tcTemp" select tcTotals index on linkfield tag linkfield * Bind sum showing controlsource to appropriate fields * Method controlling parentrec change * Relation not used taking buffering into account * AdjustSumRecPointer - custom method lparameters cLinkKey seek(cLinkKey, "tcTotals", "LinkField") * a refresh for controlsource(s) here * Method controlling sumvalue * AdjustSumValue - custom method lparameters cLinkKey, cControlSource, cTotalsFieldName *cSumChange = orgtotal + (newval - oldval) nDotPos = rat(".",cControlSource) cFieldName = substr(cControlSource,nDotPos+1) cTableName = substr(cControlSource,1,nDotPos-1) nOldVal = nvl(oldval(cFieldName,cTableName),0) nNewVal = nvl(eval(cTableName+"."+cFieldName),0) if !seek(cLinkKey, "tcTotals", "LinkField") insert into tcTotals values (cLinkKey, 0, 0, 0) endif replace (cTotalsFieldName) with ; eval(cTotalsFieldName) + (nNewVal - nOldVal) * a refresh for controlsource(s) here * A numeric field effecting sum1 value * lostfocus thisform.AdjustSumValue(myParentKeyHere, this.controlsource, "sum1")Intermediate variables are used for readability. Still advantage would be all summing done once at init then only one sum value is updated. If an array or just one var was used then you would only set new value of it (bound to a control on form would need no refresh at all).