Subject Re: [IBO] TIB_LookupCombo in a Grid
Author mikehickman@hotkey.net.au
Hi Helen,
Hoping you would answer. Sorry if it looked confusing. Details below.

Detail table which I want to insert new records into is Bankdetails.
This is referenced by the following query


Query name sqlbook
sqlbook.sql:='SELECT BANKCODE , DTE , REF , ACCOUNTAMOUNT ,
BANKAMOUNT , BANKSTREF
, BOOKREF , CHART , CHQNO , DETAILS ,
RECEIPTNO , COSTCROSSREF,LINENO
FROM BANKDETAILS
Where Bankcode=:Bankcode
Order By Lineno'


This table has an index IDXBankDetails4;Ascending Sort.

Datasource named dsbook property dataset is set to sqlbook

sqlchart query is as follows :
SELECT ACCOUNT , CHARTDESC , CHARTGROUP , CHARTSUB
FROM CHART

The chart table has an indexed field IDXCHART which is unique.
sqlbook.chart and sqlchart.account use the domain ChartAccount.

Sqlchart has the following properties :
Keylinks......chart.account= BankDetails.chart
Keysource .... dsbook

The form has a grid ... Grid1. Its datasource property is dsBook.

To Summarize. The name of the query in the Grid is sqlBook.
Name of the datasource linking the grid to the query is dsBook
The name of the sql for displaying in the LookupCombo is sqlChart

The intruiging thing is that the lookupcombo acts as expected if
placed on the form outside of the grid. My problem occurs when I Cut
and Paste to the Grid.
Then the LookupCombo is not visible and entering the Chart column of
sqlbook does not activate the LookUpCombo.

I have looked at this code for hours and am probably overlooking the
obvious

Thanks for answering
Mike


--- In IBObjects@y..., Helen Borrie <helebor@d...> wrote:
> At 06:54 AM 03-09-01 +0000, you wrote:
> >Hi All,
> >Attempting to use TIB_LookupCombo in a grid fot the first time.
> >Following instructions in StarterGuide for IBO4.
> >
> >I have defined the following in a TIB_Query
> >
> >TIB_Query.name 'sqlbook'
> >sqlbook.KeyLinks :='chart.account=bankDetails.chart'
> >sqlbook.Keysource :='dsBook'
> >
> >TIB_Datasource.name :='dsbook'
> >dsbook.dataset :='sqlbook'
> >
> >TIB_Grid.datasource:='dsbook'
> >TIB_LookUpCombo.datasource:='dschart'
>
> Mike,
> This looks confused. Is the query sqlbook the main dataset or the
lookup dataset? Or, to put the question another way, is sqlbook
looking up a query over the bankDetails table, or is a query over the
bankDetails table looking up something in the sqlbook query?
>
> Please help by providing:
>
> The name and SQL of the query whose data are being displayed in the
grid, and the name of the datasource that links this dataset to the
grid.
>
> The name and SQL of the query whose data are being displayed in the
lookupcombo.
>
> Thanks,
> Helen
>
> All for Open and Open for All
> InterBase Developer Initiative ยท http://www.interbase2000.org
> _______________________________________________________