Subject Re: [IBO] Recalculating a records fields
Author Helen Borrie
At 11:51 AM 10/07/2007, you wrote:
> > THIS IS INCORRECT.
> > qryClients.InvalidateRow(qryClients.RowNum);
>
>
>I must be using the wrong version of IBO. (tried both 4.6 & 4.7). I
>get compile time errors with qryClients.InvalidateRow and
>qryClients.RowNum (qryClients is a TIBOQuery).
>
>I did a search on the source and the only method I could find with
>.InvalideRow was on a TIB_CustomGrid.

I think you'll find the method you want is InvalidateRowNum
(aRowNum). Pass the IBOQuery's RowNum property as the argument.

Note that an Invalidate... call merely signal to the object that the
record at that location will need refreshing next time it is
accessed. So, when you access that row again, a single-record query
will be fired off to update your calculated field.

Unless I've missed something, your internal counter is counting the
number of times OnCalcFields is called. This doesn't tell you
anything about how many rows are affected by whatever method call is
triggering the event, only how many times the method is being
called....what's the point of it? You don't know (and don't need to
know) how many rows are in the buffer or (even) how many rows need to
be refetched as the result of a triggering operation. OnCalcFields
is a row-level event that gets triggered every time a row is fetched
(or re-fetched) into the row buffer. InvalidateRowNum is just one
such operation; RefreshXxxx involve others; even scrolling up or
down the master set may involve invalidation and refetching of rows
in the buffer.

Helen