Subject Re: [IBO] Problem with IB_LookupCombo
Author Christoph
Thanks for the help. You were right with the first suggestion - the
query wasn't open. Doh.

It's working now, and so are two grids acting as master/detail. Now I
just need to figure out searching and I will have a complete
application...


Christoph

--- In IBObjects@yahoogroups.com, Norman Dunbar <norman.dunbar@l...>
wrote:
> Sorry Christoph,
>
> I'm sending this again on the grounds that I was completely confused (or
> drunk) when I sent the previous version! At least I did say that
they were
> *rough* notes. Thank goodness Helen is asleep or I'd be in serious
trouble
> by now :o)
>
>
> Black colour sounds like you have not opened the query/cursor associated
> with the dropdown. However, if this is not the case, then here are some
> rough notes from a little project of mine :
>
>
> A TIB_Query to select the code field and the description field from the
> appropriate table, ordered as desired. Call it qryLookup, set the SQL to
> 'select code_field, description_field from lookup_table order by
> description_field'. Add a TIB_DataSource (not dataset as I
originally said)
> named dsLookup and link the two together using the data source's dataset
> property.
>
> Set the TIB_LookupCombo's DataSource field to the above data source
> (dsLookup)
>
> Set the KeySource property on qryLookup to the 'main' query's data
source -
> the one which has a code field for which you wish to show the
description.
> (dsMain in my case).
>
> Set the KeyLinksAutoDefine property to false on the query above
(qryLookup).
>
> Set the KeyLinks property to the correct setting which needs to be
> 'lookup_table.primary_key=main_table.code_field' and there should be no
> spaces between the equal (=) sign and every thing else.
>
> Optionally set the code field to non-visible in qryLookup's
FieldsVisible
> property.
>
> Open the lookup dataset when the form is being shown for the first time.
>
> [Optionally] refresh it as and when required.
>
> Close & unprepare it when the form is closed.
>
>
> The above works for me - provided I remember to specify the keylinks
using
> table and column names and NOT query names, and that I remember to
open the
> qryLookup as well :o)
>
> HTH
>
> Cheers,
> Norman.
>
>
> -------------------------------------
> Norman Dunbar
> Database/Unix administrator
> Lynx Financial Systems Ltd.
> mailto:Norman.Dunbar@L...
> Tel: 0113 289 6265
> Fax: 0113 289 3146
> URL: http://www.Lynx-FS.com
> -------------------------------------
> This email is intended only for the use of the addressees named
above and
> may be confidential or legally privileged. If you are not an
addressee you
> must not read it and must not use any information contained in it,
nor copy
> it, nor inform any person other than Lynx Financial Systems or the
> addressees of its existence or contents. If you have received this
email
> and are not a named addressee, please delete it and notify the Lynx
> Financial Systems IT Department on 0113 2892990.