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.
DougBennettAsked:
Who is Participating?
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.