Refresh Total in Subform

G

Guest

I have a field in the subform which SUMs a particular field and is then
referenced and displayed in the main form. How do I get the subform to
refresh so that the value will include the latest figure just entered? Right
now, the SUM that includes the just entered value will only show up after I
close and reopen the main form. Thanks.

ck
 
D

Damien McBain

CK said:
I have a field in the subform which SUMs a particular field and is
then referenced and displayed in the main form. How do I get the
subform to refresh so that the value will include the latest figure
just entered? Right now, the SUM that includes the just entered value
will only show up after I close and reopen the main form. Thanks.

ck

DoCmd.Requery "frmMyForm"
 
A

Allen Browne

The new total should show up once the record in the subform is saved, e.g.
if when tab past the end of the record.

If you want to force the subform record to save form code in the main form,
you could use:
Me.[NameOfYourSubformControlHere].Form.Dirty = False

If you need to force the main form to recalculate the calculated controls:
Me.Recalc
 
G

Guest

I also have a subform called, "effective_contract_detail" within the main
form, "Effective_Contract." However, when I update my detailed line items
within the "Effective_contract_detail" form, the DSUM total in my main form
does not update until I completely exit out. Where do I add the "me.recalc"?

Thank you!
gg :)
 

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