Subject Re: OnvalidateField error
Author Marco Menardi
Hi Nico
What about
ARow.ByName ('LANGUAGE').AsString := FieldByName('LANGUAGE').AsString;
be changed with
MyQuery.FieldByName ('LANGUAGE').AsString :=
crCust.FieldByName('LANGUAGE').AsString;

Not related to your problem:
you can avoid Active := True, since for cursors "First" opens it and
put you on the first row.
I've the feeling that Active := True and First do the job twice...

regards
Marco Menardi

--- In IBObjects@y..., Nico Callewaert <ncw@t...> wrote:
> Hi again Marco,
>
> Hi Marco,
>
> That's the way I'm doing it, but in that event, I assign a value to
> another field. Here's the code :
>
> if AField.FieldName = 'MASTERNO' then
> begin
> if Trim (AField.AsString) <> '' then
> // Get the default language for this master
> with crCust do
> begin
> Active := False;
> if not Prepared then Prepare;
> Params [0].AsString := Copy (AField.AsString, 1, 5);
> Active := True;
> First;
> if not Eof then
> ARow.ByName ('LANGUAGE').AsString :=
> FieldByName('LANGUAGE').AsString;
> end;
> end;
>
> My customer is lazy :-), so I'm providing him with a default value for
> the language.
>
> Nico