Subject Re: [IBO] Changing MasterLinks at runtime
Author Bob
Thanks Helen (and Geoff). Is there any problem with just leaving the two
detail sets open at the same time? They're both read-only -- I do not need
to change them at all, just pull data from them for display purposes. I
don't really need to switch between them very often (only when a user
creates a contract, or in the unlikely event of a contract type change), but
is it a bad idea to have both sets open and available?


""Helen Borrie (TeamIBO)"" <helebor@...> wrote in message
news:5.1.0.14.2.20020507114858.034eae20@......
> At 04:18 PM 06-05-02 -0500, you wrote:
> >I need to change MasterLinks at runtime. The two possibilities are:
> >
> >FRTLANE.ORIG_ID=CONTRACT.LOC_ID
> >or
> >FRTLANE.DEST_ID=CONTRACT.LOC_ID.
> >
> >The MasterLinks need to change if the user changes the contract type from
> >"Purchase" to "Sale". How do I change the links and refresh the FRTLANE
> >dataset?
> >
> >I see that the MasterLinks are a TIB_StringList, and I can .Clear or .Add
> >them, but am not sure where to go from there.
>
> You don't touch the MasterLinks of either detail set at all. The property
> you want to reassign is MasterSource.
>
> Write a procedure called something like "SwitchDetails", to which you pass
> the reference to the detail set you want to switch to. You need to
> complete any outstanding work on the "live" detail set, then close
> it. Then simply swap over the MasterSource property.
>
> MyDataModule.SwitchDetails(aQuery: TIB_Query);
> begin
> with aQuery do
> begin
> if MasterSource <> nil then
> Exit; // because it's already the right one
> if Name = 'qryPurchase' then
> qrySale.MasterSource := nil
> else
> qryPurchase := nil;
> MasterSource := dsMaster; // the datasource of the master set
> end;
> end;
>
>
> regards,
> Helen Borrie (TeamIBO Support)
>
> ** Please don't email your support questions privately **
> Ask on the list and everyone benefits
> Don't forget the IB Objects online FAQ - link from any page at
> www.ibobjects.com
>
>
>
>
___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
> without the need for BDE, ODBC or any other layer.
>
___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
> keyword-searchable FAQ, community code contributions and more !
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>