Subject Re: [IBO] How can I...
Author Helen Borrie
Andre,

At 12:02 AM 28-08-01 -0400, you wrote:

>I would like to update the fields as sonn as possible. As an example, when the user enters a social insurance id, in a TIB_Edit field, I do a request on the database and if the id is present I pick up some values and assign them to different TIB_Edit fields, and some of those fields are IB_LookupCombo.

Let me try to understand this. You have three datasets:
(1) the Main (Keysource) rows
(2) the lookup, which is connected through KeyLinks to one column in the Keysource dataset
(3) one that takes as an input parameter the ID entered by the user and queries a different table. If it finds a match, it outputs some columns, which you then plug in to some columns in the other two datasets.

>So I would like to enter immediatly the value that was returned by my query in the TIB_LookupCombo.

This I don't understand. Are you saying that you want to create a new row in the lookup dataset? or are you saying that you want to find a key value in the lookup dataset that matches the value returned?


>I know that if I do the following:
>IBLC_Langue.DataSource.Dataset.FieldByName('ITEMCODE').AsString := ParamByName('BEN_LANGUE').AsString;
>The dataset of the LookupCombo for the lookup dataset will be updated with the new value

The lookup dataset should not get updated. Its function is to provide a value corresponding to a key that is searched for by the main (keysource, parent) dataset via the lookup key, i.e. the column that it stores as a key to that link. The lookup dataset's KeyLinks property points to that key.

>What I would like is the equivalent but to update the KeySource:
>What could I put after IBLC_Langue.???.FieldByName('BEN_LANGUE').AsString := bla, bla, bla;
>Does this make sense?

Not yet, but we are getting there. Could you show the SQL for each of the three queries, please, and also the KeyLinks of the lookup dataset?

Regards,
Helen

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