Subject Re: [IBO] Howto manually update control when detail dataset chang es
--- In IBObjects@y..., Norman Dunbar <norman.dunbar@l...> wrote:
> Mirco wrote :
> >> The question is: how do I know when the detail dataset requeries?
> >> There is a straight-forward answer to this, which I heard
> >> times: do your update whenever the *master* datasource changes
> >> row.
> >> As I said, this seems wrong to me. No, rather ineffective. It
> >> yes, but you miss the point that
> >> 'master dataset scroll' is not equal to 'detail dataset requery'.
> Correct me if I'm wrong on this, but surely, when the master dataset
> scrolls, the field linking the detail data set to the master must
change, so
> the detail query must therefore be re-queried ?
> Example :
> Customer and Invoices, Customer is master and Invoices the detail.
They are
> linked by Customer_number.
> The master query, for sake of argument is 'select * from customer'
and the
> details is 'select * from invoice' - they are joined in the
correct, which
> is set to link them by customer_number. (MasterLink probably - I'm
> blind here :o) )
> So, when the customer details are displayed, the invoice details
are really
> 'select * from invoice where customer_number = :customer_number'
and the
> parameter is automagically filled in from the customer dataseet's
> row.
> When the customer dataset is scrolled, the customer_number
> changes, so the detail is re-queried.

Correct so far

> Hence, you would put your processing in the AfterScroll event as

Wrong for the reason I stated before. The event to react on is
the 'requery of the detail' dataset, not one of the (perhaps
multiple) events causing the requery.
When I refresh my visualization in the AfterScroll of the master,
then I would miss all those other situations where the detail might
requery. (Which I probably don't know all... I am dealing with the
detail set and want to display that.... why bother with other
What if the master is a detail query itself? Then it gets requeried
if another query scrolls... does it send an AfterScoll then? Does my
visualization update properly?