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?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ThaddyConnect With a Mentor Commented:
Go to the fields editor.(Doubleclick on the table, then rightclick)
Add the two fields you want to multiply
Then, create a new field, set its type to calculated.
and its fieldtype to float. We'll call it 'Calc'
Then, on the OnCalcFields event of the table, use something like:
with table1 do
 FieldByname('Calc').AsFloat:=FieldByName('Field1').AsFloat*FieldByName(Field2').AsFloat;

0
All Courses

From novice to tech pro — start learning today.