Subject 2-Posting a new record in a Dataset linked to a TIB_Grid
Author Roberto Freitas
Hi, Helen
I will try to remake question from the begining, but adding some new
informations !-).
I am using a TIB_Grid linked to a TIB_DataSource and a TIB_Query.
I have this code at IB_QueryContaAfterInsert event:
with IB_QueryConta do
FieldByName('cct_ciireg').AsString := Gl_ciireg_f;
Im this case, Gl_ciireg_f = '10010001'
For a new record, the user types values for other fields on the
TIB_Grid. Field cct_ciireg is not visible on the grid, so user cannot
change it.
I checked that the code above actually executes.
I watched FieldByName('cct_ciireg').AsString in 2 different places:
at end of IB_QueryContaAfterInsert event and
at end of IB_QueryContaBeforePost event
In both places, the value is correct = '10010001'
Although, when posting record, I got this ISC Error Message:
ISC ERROR CODE: 335544347
validation error for column CCT_CIIREG, value "***null***"
If FieldByName('cct_ciireg').AsString = '10010001' just before post
record (IB_QueryContaBeforePost event), how can I get this error?

P.S.: I am sorry, I know it's my fault, but I dont't understand what
it means:
"I suggested rewriting your handler so that it refers to the
IB_Dataset argument of the handler method. I still suggest that."