totals within subforms

G

Guest

hello,

I have a subform based on a query. The query has a calculated field based on
fields in the query, e.g. total = item * price. There are a number of records
in the query. What I would like to do is display the total of the calculated
field in the main form and add it to another value. I have put a hidden sum
in the footer of the sub form. This calculates the total, but does not update
if I change a value in the query, e.g. the number of items. Can anyone help ?

Thanks
 
T

tina

the unbound textbox control in the subform's Footer section will update
automatically when you move to another record in the subform. if you want to
force an immediate update without moving to another record, you can write
the changed data to the table by adding code to the AfterUpdate event of the
(for instance) "number of items" control in the subform, as

Me.Dirty = False

or

DoCmd.RunCommand acCmdSaveRecord

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