Cilck or IntercativeChange of what?
>I've got a grid of entries, the two important columns are a tick box (required), and a time in hrs (hrs).
>
>Where is the best method to recalculate the total hours (TxtNHours), in the click event method or the interactive change event?
>
>My calculation code looks like this:
>
>
>DODEFAULT()
>SELECT SUM(hrs) as total FROM linemarkingbody WITH (buffering=.t.) WHERE linemarkingbody.no=linemarkinghead.no AND required INTO CURSOR tmptotal
>IF ISNULL(TMPTOTAL.TOTAL)
> REPLACE totalhrs WITH 0 IN linemarkinghead
>ELSE
> REPLACE totalhrs WITH tmptotal.total IN linemarkinghead
>ENDIF
>thisform.txtNHours.Refresh
>
If it's not broken, fix it until it is.
My Blog