Subject | Re: Recursive call of TIB_LookupCombo.OnChange |
---|---|
Author | tibotaka |
Post date | 2002-03-28T16:17:42Z |
--- In IBObjects@y..., Gabriel Juncu <gjuncu@c...> wrote:
from "LookupQry" is in AfterScroll event of "LookupQry"...
Code snippet:
procedure Tfrm."LookupQry"AfterScroll(IB_Dataset: TIB_Dataset);
begin
inherited;
with IB_Dataset.KeySource.DataSet do <- this is "Qry"
begin
case State of
dssInsert,
dssEdit:
begin
"Qry"-> FieldByName('SOME_FIELD').AsString :=
"LookupQry"-> IB_Dataset.FieldByName('SOME_FIELD').AsString;
...etc...
end;
end;
end;
end;
I think OnChange event of LookupCombo is "too dangerous and confused"
for your needs... ;-)
Sorry for a bit long post, but I hope it helps...
Tibor
> Hi List,to
> I'm using IBO 4.2Fn and Delphi 6 and the following simple app:
> Two TIB_Querys: Qry and LookupQry, and a TIB_LookupCombo connected
> LookupQry and updating Qry. Everything works ok until:updates;
> In LookupCombo.OnChange event, I put the following statement:
>
> Qry.FieldByName('SOME_FIELD').AsInteger := 1; //example only
> Note that SOME_FIELD is DIFFERENT from the field the LookupCombo
>OnChange
> ...
> Is there any way that I can assign a value to a Qry's field in the
> event of the LookupCombo? (LookupQry contains some default valuesfor some
> fields in Qry, so when a user chooses a value in the Lookup , someother Qry fields
> must be filled with the default values that the user can changeafterwards).
>In my opinion far better way to fill default values of "Qry"
> Thank You!
> Gabriel
from "LookupQry" is in AfterScroll event of "LookupQry"...
Code snippet:
procedure Tfrm."LookupQry"AfterScroll(IB_Dataset: TIB_Dataset);
begin
inherited;
with IB_Dataset.KeySource.DataSet do <- this is "Qry"
begin
case State of
dssInsert,
dssEdit:
begin
"Qry"-> FieldByName('SOME_FIELD').AsString :=
"LookupQry"-> IB_Dataset.FieldByName('SOME_FIELD').AsString;
...etc...
end;
end;
end;
end;
I think OnChange event of LookupCombo is "too dangerous and confused"
for your needs... ;-)
Sorry for a bit long post, but I hope it helps...
Tibor