Subform subtotal automatic

Subform subtotal automatic

Hello,

I have made a subform with the following fields:

Field 1: Aantal
Field 2: Prijs
Field 3: Subtotaal

I have made the following script for Subtotal:

row.Subtotaal = 0.0;

row.Subtotaal = (row.Aantal  *  row.prijs);

// calculate grandtotale

input.Totaal = 0.0;

for each rec in Werkzaamheden_2

{

    input.Totaal = (input.Totaal  +  rec.Subtotaal);

}

input.Totaal = input.Totaal;


The script works but subtotaal will not automaticly be filled in when I put a value in: Aantal en Prijs.

See attachment for an example.

Can someone please help me? Or isn't this possible?


Greats,


Erwin