Subject | RE: [IBO] Problem with IB_LookupCombo |
---|---|
Author | Norman Dunbar |
Post date | 2003-04-04T13:07:23Z |
Hi Christoph,
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, and a TIB_DataSet
which is connected to it. SQL = 'select code_field, description_field from
lookup_table order by description_field'.
Set the TIB_LookupCombo's DataSource field to the above query. (qryLookup)
Set the TIB_LookupCombo's KeySource to the 'main' dataset - the one which
has a code field for which you wish to show the description. (qryMain in my
case).
Set the KeyLinksAutoDefine property to false on the query above (qryLookup)
Set the KeyLinks property to the correct setting. See below.
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.
Setting keylinks needs to be the
'lookup_table.primary_key=main_table.code_field' and there should be no
spaces between the equal (=) sign and every thing else.
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@...
Tel: 0113 289 6265
Fax: 0113 289 3146
URL: http://www.Lynx-FS.com
-------------------------------------
-----Original Message-----
From: Christoph [mailto:lists@...]
Sent: Friday, April 04, 2003 1:37 PM
To: IBObjects@yahoogroups.com
Subject: [IBO] Problem with IB_LookupCombo
I am having trouble getting an IB_LookupCombo to work.
Is the "Thinking About Links" section of the GSG the right place to look?
I have got a form that has some controls linked to a TIB_Datasource
that is linked to a TIB_Query and everything works fine.
I then add another datasource and query for the lookup and change the
keylinks property in the query to something like
LookupTable.PrimaryKey=KeysourceTable.LookupKey.
I then set the datasource of the lookup combo to the lookup ds, the
display field to the second column in the lookup query, and the
keysource on the lookup query to be the datasource of the orignal query.
When I run it I can still browse the main query ok but the lookup
combo is black and if I drop it down the dropdown is only a couple of
pixles high.
Can somebody help me please? I am using Delphi 7 pro and IBObjects
4.2.Ib on Windows XP connecting to Firebird 1.
Thanks.
Christoph
___________________________________________________________________________
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/
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.
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, and a TIB_DataSet
which is connected to it. SQL = 'select code_field, description_field from
lookup_table order by description_field'.
Set the TIB_LookupCombo's DataSource field to the above query. (qryLookup)
Set the TIB_LookupCombo's KeySource to the 'main' dataset - the one which
has a code field for which you wish to show the description. (qryMain in my
case).
Set the KeyLinksAutoDefine property to false on the query above (qryLookup)
Set the KeyLinks property to the correct setting. See below.
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.
Setting keylinks needs to be the
'lookup_table.primary_key=main_table.code_field' and there should be no
spaces between the equal (=) sign and every thing else.
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@...
Tel: 0113 289 6265
Fax: 0113 289 3146
URL: http://www.Lynx-FS.com
-------------------------------------
-----Original Message-----
From: Christoph [mailto:lists@...]
Sent: Friday, April 04, 2003 1:37 PM
To: IBObjects@yahoogroups.com
Subject: [IBO] Problem with IB_LookupCombo
I am having trouble getting an IB_LookupCombo to work.
Is the "Thinking About Links" section of the GSG the right place to look?
I have got a form that has some controls linked to a TIB_Datasource
that is linked to a TIB_Query and everything works fine.
I then add another datasource and query for the lookup and change the
keylinks property in the query to something like
LookupTable.PrimaryKey=KeysourceTable.LookupKey.
I then set the datasource of the lookup combo to the lookup ds, the
display field to the second column in the lookup query, and the
keysource on the lookup query to be the datasource of the orignal query.
When I run it I can still browse the main query ok but the lookup
combo is black and if I drop it down the dropdown is only a couple of
pixles high.
Can somebody help me please? I am using Delphi 7 pro and IBObjects
4.2.Ib on Windows XP connecting to Firebird 1.
Thanks.
Christoph
___________________________________________________________________________
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/
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.