Subject Re: Posting a new record in a Dataset linked to a TIB_Grid
Author Svein Erling Tysvær
Have you checked that the code actually executes and have you tried
assigning the value in the BeforeInsert property? I don't know when
TIB_Query handles Before- and AfterInsert, but I do know that I'd use
BeforeInsert triggers for assigning values to the dataset in question.


--- In, "Roberto Freitas" wrote:
> I am using a TIB_Grid linked to a TIB_DataSource and a TIB_Query.
> I have this code at IB_QueryContaAfterInsert event:
> FieldByName('REGH').AsString := '10010001';
> For a new record, the user types values for other fields on the
> TIB_Grid. Field REGH is not visible on the grid, so user cannot
> change it. When posting record, I got this ISC Error Message:
> ISC ERROR CODE: 335544347
> validation error for column REGH, value "***null***"
> How can it happens, since the field was assigned to '10010001' at
> AfterInsert event?