Subject Re: [IBO] IB_LookupCombo in an IB_Grid
Author staff@belding
Hello Helen

Thanks for your comments. The two lines you suggested adding enable the example to work. (I had some typos in my prev post so I correct them here)

A simple example of embedding an IB_Lookup in an IB_Grid:


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 inside myGrid.


Use table EMPLOYEE in the grid. (try c:\program files\common files\borland\data\employee.gdb)

qrGrid has(
SQL = select * from employee
)

qrLookup has(
SQL=select country, country as job_country from country
KeySource = dsGrid
KeyLinks = country.country = employee.job_country
)

myLookup has (
DataSource=dslookup
DisplayField=job_country
)

When the JOB_COUNTRY cell is selected the current EMPLOYEE.JOB_COUNTRY is displayed and a country
can be selected from the COUNTRY.COUNTRY column.

(However constraints internal to the EMPLOYEE.GDB will cause errors. Ignore them for the purpose of this example.)

From this exercise this group could note
1. The IBO FAQ article by Lars on embedding an IB_Lookup in an IB_Grid is misleading in parts but works when the linked fields have the same name.

2. The embedding present in the IBO Samples - Contact application works but appears to establish a link between the grid cell value and the source table in a difficult to follow way.

Russell



[Non-text portions of this message have been removed]