Subject | Re: [IBO] InvalidateRows |
---|---|
Author | Gerard J.M.Houtenbos |
Post date | 2003-07-11T12:05:13Z |
I'll try to be more specific:
I have a two column TwwDbGrid and a two column TIBOQuery
(qryTest) with two float-fields.
The OnChange-event-handler of Field1 consists of:
{==================}
qryTest.FieldByName('FIELD2').AsFloat := 2 *
qryTest.FieldByName('FIELD1').AsFloat;
qryTest.InvalidateRows;
{==================}
So the value of Field2 is filled with the value of Field1
multiplied by 2.
Back to the grid. If I change the value of the column Field1, and
tap the Tab-key, then the value of column Field2 shows the
correct value, so the OnChange-event-handler works fine. However,
the record isn't posted yet. If I then change the value of the
column Field1again an EAccessViolation shows up with the text:
Access violation at address 0057497C in module 'Infas.exe'. Read
of address 0000000C.
If I change the value of Field1 and then POST the record, all
works fine and I can change the value of Field1 again without any
exceptions.
tia,
Gerard
I have a two column TwwDbGrid and a two column TIBOQuery
(qryTest) with two float-fields.
The OnChange-event-handler of Field1 consists of:
{==================}
qryTest.FieldByName('FIELD2').AsFloat := 2 *
qryTest.FieldByName('FIELD1').AsFloat;
qryTest.InvalidateRows;
{==================}
So the value of Field2 is filled with the value of Field1
multiplied by 2.
Back to the grid. If I change the value of the column Field1, and
tap the Tab-key, then the value of column Field2 shows the
correct value, so the OnChange-event-handler works fine. However,
the record isn't posted yet. If I then change the value of the
column Field1again an EAccessViolation shows up with the text:
Access violation at address 0057497C in module 'Infas.exe'. Read
of address 0000000C.
If I change the value of Field1 and then POST the record, all
works fine and I can change the value of Field1 again without any
exceptions.
tia,
Gerard
On Thu, 10 Jul 2003 13:07:00 -0700, you wrote:
>> I use a TwwDbGrid and a TIBOQuery.
>> In the OnChange-event of Field1 I change the value of Field2 that
>> is depending on Field1.
>> The change of Field2 is not visible in the grid.
>> So I use a call to InvalidateRows in the OnChange-event. Then the
>> change of Field2 is instantly visible in the grid.
>> But when I change Field1 a second time, without posting it first,
>> an exception is raized.
>> How do I solve this?
>
>You eed to be more clear here.
>
>At the very least let us know what exception was raised.
>
>Also, I can't really tell what it is you are doing.
>
>Jason
>
>
>___________________________________________________________________________
>IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
>___________________________________________________________________________
>http://www.ibobjects.com - your IBO community resource for Tech Info papers,
>keyword-searchable FAQ, community code contributions and more !
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
_________________________
Gerard J.M. Houtenbos
DoubleWood Software