Subject Re: [IBO] IB_LookupCombo in an IB_Grid
Author Helen Borrie
At 09:06 AM 08-02-01 +1300, you wrote:
> > Please show us
> > (1) the SQL for the Keysource table and
> > (2) the entry you have for KeyLinks for the Lookup table.
> >
>
>Hello Hellen, Svein
>
>Thank you for persisting on this issue. You help is appreciated.
>
>Use a new app with a single form, and EMPLOYEE.GDB.
>On the form put a connection, transaction,
>qrGrid, qrLookup (IB_Query)
>dsGrid, dsLookup (IB_DataSource)
>myGrid,(IB_Grid)
>myLookup, (IB_LookupCombo) with myLookup is inside myGrid.
>
>
>Part One: Use table EMPLOYEE in the grid.
>
>qrGrid has(
>SQL = select * from employee
>)
>qrLookup has(
>SQL=select country from country
>DataField = job_country <--- *********** doesn't belong here
>KeyLinks = country.country = employee.job_country
>)

Change to:
SQL=select country, country as job_country from country
KeySource = dsEmployee <--- ******** ESSENTIAL
KeyLinks = country.country = employee.job_country


>myLookup has (
>DataSource=dslookup

*** SHOULD HAVE
DataField = job_country

>DisplayField=country <----------- ********************
>)

Now embed the lookupcombo and you should get the results you want.

Helen

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________