• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

Calculated Fields - How to

Simple question. How do I define and access a calculated field in a table.

I have two field values i want to multiply, with the total going in the calculated field.

Thanks.
0
DougBennett
Asked:
DougBennett
1 Solution
 
binhoCommented:
Define a third field in your TTable component (using Fields Editor), and set it to "Calculated". In the TTable.OnCalcFields event, write your multiplication procedure, such as:

Field3 := Field1 * Field2;

Note: TTable.AutoCalcFields property must be set to true (default).

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now