Subject Re: [IBO] 2 Queries with same Parameters
Author Helen Borrie
At 08:45 PM 2/02/2005 +0000, you wrote:

>I have a report that pulls up line items for customer invoices by
>date range. The parameters are supplied by TIB_Edit and TIB_Date
>controls that have their ParamName property set. There are three
>parameters in all - one for the customer number and two for the
>begin/end date range.
>This works fine.
>I also have another query with the same parameters that does a Sum
>on the total of these items. I'd like this query to use the same
>parameters and change along with the edit and date controls, but I
>don't know how to hook into the change.
>Is there some property that will be triggered on a param change in
>the first query so I can provide them to the second? I'd like
>something like the MasterParamLink property, but this seems to only
>use column links to the master table. I need to link to the params
>in the master to get the date range.

If it is the case that you want to apply Query A's parameters to Query B
each time Query A's parameters change, then a TIB_StatementSource object
linked to Query A might help here. It's used to implement custom linking
between a statement object and another object.

If I understand what you want to do, it seems that you could hook into its
OnParamsDataChange event, pick up the FieldName and Value properties of the
supplied Field argument and pass those to a method that
1) cancels or completes any pending DML operation on Query B
2) closes Query B
3) assigns the new value to the named parameter
4) opens Query B