Subject Re: OnValidateField error
Author Marco Menardi
Maybe when you post the record, you assign some field values too, so
the event is fired again.
Maybe in the event, you should check if ARow and AField are assigned,
and/or if they refer to the field you want to check.
I don't use that event in my program, so mine are just suppositions...
Let me know if it works
regards
Marco Menardi

--- In IBObjects@y..., Nico Callewaert <ncw@t...> wrote:
> Hi List,
>
> I have something strange. I have a query with 3 fields :
> MASTERNO, PRODUCTNO, LANGUAGE.
> When I fill in the fields, the OnValidateField event of the
> query if triggered. Until here, everything is fine. But when I post
> the record, the event is fired again. So, my fiirst question is : why
> the event has to be fired twice ?
>
> In that event, I'm checking some things, to ensure the
integrity
> of the data. When the event fires the first time and I call
> "ARow.ByName ('LANGUAGE').AsString", no problem. But when I do the
> same call the second time the event is fired, I have a TIB_Statement
> error Field "LANGUAGE" not found. Then I started to dig into the
> problem, I found that the first time the event is fired
Arow.ColumnCount
> = 3, and the second time the ColumnCount is only 1.
>
> Is there somebody who had this problem before ?
>
> Thanks in advance,
>
> Nico Callewaert