Subject | Re: [IBO] TIB_LookupCombo and MasterLinks |
---|---|
Author | Boris Schlüszler |
Post date | 2002-03-10T19:29:19Z |
Thanks fopr your quick answer, Helen!
I will try this!
Regards,
"Helen Borrie (TeamIBO)" schrieb:
I will try this!
Regards,
"Helen Borrie (TeamIBO)" schrieb:
> At 02:33 PM 10-03-02 +0100, you wrote:
> >Hello!
> >
> >I'd like to use a TIB_Lookupcombo in a grid.
> >The LookupCombo should list some names from a mastersource and on
> >selection the name (not some key) from the master source should be saved
> >into the underlying table.
> >
> >Is that possible, and how?
>
> The linking paradigm to use is the KeySource-Lookup relationship. This
> works perfectly provided you want to store a key and not the
> DisplayField. However, it is possible to make it work the way you want,
> but you must make absolutely certain that there are no duplicate values and
> no nulls in the description fields (one empty-string value is OK). The
> best way to ensure this is to place a unique index on that column.
>
> The lookup dataset should not select the primary key of the lookup table,
> but should instead "fudge" the key by picking up the Description column as
> if it were the primary and then picking it up again as an alias, for
> populating the DisplayField. Here is the SQL:
>
> SELECT Description, Description AS Descr
> from MyLookupTable
> ORDER BY Description
>
> In the KeyLinks of this dataset, enter:
>
> MyLookupTable.Description=ParentTable.DescrField
>
> This assumes that the Parent (or "Keysource") table wants the value to go
> into a column named DescrField. It can be whatever you need, of course!
>
> Set the Keysource property of the lookup dataset to be the datasource that
> is pointing to ParentQuery. (Don't confuse this with the Datasource
> property: leave this as nil.)
>
> Set the Visible property of Description to False.
>
> Set the DisplayField property to Descr
>
> That should do it.
>
> 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/