Subject Re[2]: [IBO] Recursive call of TIB_LookupCombo.OnChange
Author Gabriel Juncu
Hi Harald,

Yes, you are right, but to be short I did not mention that LookupOnChange
starts with:
"if not Qry.NeedToPost then Exit;"
and TIB_DataSource AutoEdit and AutoInsert are both FALSE.
And the user must be able to view and eventually modify the proposed values
if he wants to before posting the record.

Thank you anyway!

Thursday, March 28, 2002, 3:49:29 PM, H.Klomann wrote:

> Hi Gabriel,

> the OnChange event will occur by various actions,
> eg. browsing,insert,update eg. The result will be, that
> your query allways goes in editMode when browsing and FieldValue
> changes.

> A better solution would be to make your field updates here :

> procedure TForm1.QryBeforePost(IB_Dataset: TIB_Dataset);
> begin
> if IB_Dataset.State in [dssInsert,dssUpdate] then begin
> if Qry.FieldByName('LOOKUP_FIELD').OldAsVariant <>
> Qry.FieldByName('LOOKUP_FIELD').AsVariant then begin
> Qry.FieldByName('SOME_FIELD').AsInteger := 1;
> end
> end;
> end;

> Harald