Board index » delphi » Calculated Fields Problem

Calculated Fields Problem

Hi ther,
I have a Salary and a Facility Field in my Access DB .. I need the Facilty
to be calculated from salary..
So in the fields editor I set an OnChange event handler for my salary field
to calculate the facility evertime the salary field changes .. That was all
fine but as soon as i change my focus, this calculated facility disappears,
and is this value not added to the table on disk.

So I wrote a ongettext handler for facility, thinking it might be better to
work it out when facility is sposed to be shown. But I got an error that the
table was not in edit or insert mode, but when i set the table to edit. then
the app crashing with a stack overflow.

Please help is there anyway to do this, this way or do i have to just
calculate the facility when the salary is first entered, and it changes
focus from the DBedit control.

Thanks OverSoul

 

Re:Calculated Fields Problem


Why do you have a FacilityField in your table, when it's a calculated field?

Do you post the new value to the table when you leave the record (or grid or
DBEdit)?

Alfred.

"OverSoul" <overs...@venturenet.co.za> schreef in bericht
news:3a26228c$0$234@hades.is.co.za...

Quote
> Hi ther,
> I have a Salary and a Facility Field in my Access DB .. I need the Facilty
> to be calculated from salary..
> So in the fields editor I set an OnChange event handler for my salary
field
> to calculate the facility evertime the salary field changes .. That was
all
> fine but as soon as i change my focus, this calculated facility
disappears,
> and is this value not added to the table on disk.

> So I wrote a ongettext handler for facility, thinking it might be better
to
> work it out when facility is sposed to be shown. But I got an error that
the
> table was not in edit or insert mode, but when i set the table to edit.
then
> the app crashing with a stack overflow.

> Please help is there anyway to do this, this way or do i have to just
> calculate the facility when the salary is first entered, and it changes
> focus from the DBedit control.

> Thanks OverSoul

Other Threads