Subject Re: [IBO] problem with ib_lookupCombo and new values
Author Ramil
Monday, May 15, 2006, 12:03:44 AM, you wrote:

> I am using an ib_lookupCombo embedded in an ib-grid.
> It worked ok : I had my description field : (Famille_vegetale)
> corresponding to the chosen id_famille correctly displayed in the
> grid when I chose an item from my lookupcombo.
> But I complicated things : I added a popupmenu opening a
> tib_lookupdialog in order to create a new Famille_vegetale when it
> does not exist in the lookupcombo.
> But the new description field (Famille_vegetale) keeps displayed
> only as long as I remain on the modified row.
> Where can I put code to update this field ?

> The sql of my main query is the following :
> SELECT ESPECES.ID_ESPECE
> , ESPECES.ID_FAMILLE
> , ESPECES.NOM_ESPECE
> , FAMILLE_VEGETALE
> , ESPECES.UNITE_ESPECE
> , ESPECES.PRIX_MOYEN
> FROM ESPECES
> JOIN FAMILLES
> ON (ESPECES.ID_FAMILLE = FAMILLES.ID_FAMILLE)

> The key relation is ESPECES.

> In my datalookupquery Ihave the following sql :
> SELECT ID_FAMILLE
> , FAMILLE_VEGETALE
> FROM FAMILLES

> The links seem ok.

> And I have put code on the afterscroll method of my dadalookup
> query :
> "
> if IB_QueryEspece.State in [dssEdit, dssInsert] then
> IB_QueryEspece.FieldByName('FAMILLE_VEGETALE').AsString :=
> IB_QueryFvegetale.FieldByName('FAMILLE_VEGETALE').AsString;
> end;
> "
> What else remains to be done ?
> If someone could tell me ...

Assign these Properties for the lookup Query (IB_QueryFvegetale):

KeyLinks - FAMILLES.ID_FAMILLE=ESPECES.ID_FAMILLE
KeyDescLinks - FAMILLE_VEGETALE=FAMILLES.FAMILLE_VEGETALE

See details in IB_OBJECTS_4_5.HLP about KeyDescLinks.

--
Best regards,
Ramil R. Khabibullin khabibr@...