Summing totals in subform

P

Paul Doree

Hi,

I have a mainform and a subform. In the subform footer there is a control
(ctlMaterialsTotal) which sums the materials cost field in the subform i.e.
=Sum(MaterialsCost)

On the main form I have a button which generates an invoice and there are a
few checking routines built into it, one of which relies on the value in
ctlMaterialsTotal

The problem I keep on running into is that the ctlMaterialsTotal only gets
updated when the user actually physically updates the current record in the
subform (i.e. tabs to the next row), so the routines which are called from
the button on the main form always 'see' the previous value. I have tried
all sorts of ways to force the ctlMaterialsTotal to update to the latest
value such as refresh, requery etc.but cannot get it to work.

Any suggestions anyone - it's driving me nuts!


Paul
 
T

tina

try putting a "requery calculated control" action in the AfterUpdate event
of *each control* in the subform where a user may add or change data that is
used in the calculated control.

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top