D Sum on a sub form

S

Simon

I have a form with a subform datasheet ( frmORderProducts) in the
Main form (frmORder) i would like to put a field on the main form
that will do a Dsum of the field txtOrderQuantity from the subform

How would this be done

Thanks very much
 
R

Richard

Hi Simon,

You could try something like this: In the sub forms "form footer†make a new
textbox, in the control source put =DSum([OrderQuantity]) in the on
"change" event of the same control put Me.Requery. Next on the main form
place a new textbox that refers to the textbox on the sub form something like
this:

=[Form2].Form!text14 Replace with your control names.

I did not use Dsum on my form I just used =Sum ([some field]) works ok for
what I needed.

Richard
 

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