Subject RE: [IBO] Grid lookup Please!!!
Author Dion
Hi All,

I have got to the point where I can edit the titleid value in the grid, but
not with the dropdown(embedded). When following Helens instructions, I get a
'field not found' error. What should the KeyLinks look like?

MemberBen (NB!!!!! a table in the database)
memberid benid titlid firstname surname ...

Beneficiary (NB!!!!! a table in the database)
benid titleid firstname surname ...

Title (NB!!!!! a table in the database)
titleid title

qryMemberIdBen (a 'master' dataset, ib_query, in the application.)
this is a join between Member and Beneficiary.

qryTitleLK (a 'lookup' dataset, ib_query, in the application for the
dropdown in the grid.)

I don't understand how you can prefix TitleId with either 'MemberBen' or
Firstly, qryMemberIsBen is not an actual table in the database, and
MemberBen does not have a column called 'TitleId'.

> KeyLinks of the Lookup dataset:
> TitleID=MainQuery.TitleID


-----Original Message-----
From: Helen Borrie (TeamIBO) [mailto:helebor@...]
Sent: Sunday, January 20, 2002 6:20 AM
Subject: Re: [IBO] Grid lookup

At 03:59 PM 20-01-02 -0800, you wrote:
>Hi all,
>Is it possible to have a lookup on a field in a "joined" table. For
>if MemberBen is the table representing the relationship between a Member
>his Beneficiaries, and titleid is the foriegn key in the Beneficiary table,
>how do you get a drop down in for eg a grid, of all possible titles from
>Title table. There seems to be a problem declaring KeyLinks for the lookup

Lookup fields refer to columns, not tables (but see my NOTE, below) so the
join doesn't affect the ability to implement the lookup. Just don't include
the Title table in the join, though. Use a correlated subquery to bring the
Title text into the main query. Include TitleID in the field list for the
main query, just don't display it.

Mainquery would be

SELECT a.Field,
(SELECT Title as The_Title
FROM Titles t WHERE t.TitleID = b.TitleID),
FROM (tables, joins and wheres)

The lookup dataset is

SELECT TitleID, Title FROM Titles

KeyLinks of the Lookup dataset:

KeyDescLinks of the Lookup dataset:

Don't forget to link the lookup dataset's KeySource property to the
datasource of MainQuery.

Just make sure the joined query is squeaky-clean with respect to join syntax
and table identifiers.
Use JOIN, not the SQL-89 inner join syntax.

Note: If you've eliminated all possibility of ambiguity and yet find you
get problems using the aliases, then remove the aliases and substitute with
fully-qualified columns in the join statement. Do that as a last resort,
though. IBO should be able to peel back and do the linking through the


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

IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________ - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to

Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002