Subject Re: [IBO] TIB_LookupCombo in a Grid
Author mikehickman@hotkey.net.au
--- In IBObjects@y..., Helen Borrie <helebor@d...> wrote:
> At 08:40 AM 03-09-01 +0000, you wrote:
> >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 KeyLinks between the lookup table should be the field in the
lookup table that determines the uniqueness of the lookup rows.
Normally this would be the primary key of the lookup table. I can't
see the relevance of the indexed field IDXCHART here, since it's not
in the dataset.
>
> Is Account in the table chart unique? (it needs to be, or the logic
won't work).
MH> Yes it is the primary field
>
> Why do you have so many fields in the lookup dataset? I assume you
only want the field Account from chart to be written to Chart in the
bankDetails table?
>
>
MH>In the new record the user enters Information into each field .
Some information is retrieved from another dataset, in this case from
the Chart table. All fields may contain data.
> >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.
>
> Do you realise that, when it's embedded in a grid, the lookupcombo
is only activated in dssEdit or dssInsert? Have you tried putting
the main dataset into Update mode to test this?
MH>Yes, as I say I get the correct behaviour id the lookupcombo is
placed outside the grid. It is only after I Cut & Paste that I run
into problems.
MH>I wonder if it is the way I have been handling transactions> I
have left the query in default i.e. have not set an explicit
transaction component.

Mike
>
> Cheers,
> Helen
>
> All for Open and Open for All
> InterBase Developer Initiative ยท http://www.interbase2000.org
> _______________________________________________________