calculating in VBA

killerwhale65

Registered User.
Local time
Today, 12:07
Joined
Jun 28, 2004
Messages
32
hi all,

i have a mainform with a subform.

in the subform i have 2 fields: duur and subtotaal
in duur i enter a number.
in subtotaal a calculation has to occur: =20*([duur]/60)
i tried to do this calculation in VBA but then i got the same value on every record in the subform.

But now the problem:
in the mainform i have a control 'totaal' that needs to do a DSum of subtotaal.
And here i am getting into troubles since subtotaal is not stored in the table but calculated.

The formulla for DSum would be:
Me.Parent!totaal = DSum("subtotaal", "tblFacturenDetail", "[FactuurID] = " & Me.Parent!FactuurID)

but as said, subtotaal is not stored.

How should i proceed?

Thanks!
 
How should i proceed?

By using the search facility that comes with the forum :D
Question has been asked before so you'll definitely find your answer.

RV
 
ok, i found that i should do the calculation in a query instead of in the form. Now it is indeed stored. But the problem now i that i cant add data in a form thats based on a query. So back to the same question again: how should i proceed?
 

Users who are viewing this thread

Back
Top Bottom