[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'DB' (#fcl)

# TDataSet.OnCalcFields

Event triggered when values for calculated fields must be computed.

## Declaration

Source position: db.pas line 1764

`public property TDataSet.OnCalcFields : TDataSetNotifyEvent read FOnCalcFields write FOnCalcFields;`

## Description

OnCalcFields is triggered whenever the dataset needs to (re)compute the values of any calculated fields in the dataset. It is called very often, so this event should return as quickly as possible. Only the values of the calculated fields should be set, no methods of the dataset that change the data or cursor position may be called during the execution of this event handler. The frequency with which this event is called can be controlled through the TDataset.AutoCalcFields property. Note that the value of lookup fields does not need to be calculated in this event, their value is computed automatically before this event is triggered.

## See also

TDataset.AutoCalcFields |  | How often should the value of calculated fields be calculated
TField.Kind