calulated field from subform

R

Ron

I have what I think is a pretty standard billing form. It comprises a main
invoice form linked to an invoice details form for line items. Each line
item ends in a total field which is itself a caculation of [Payrate]*[Units].

I need to create a calcuated field that adds the line items from the
subform on the fly and displays them in another field, preferably in the
main form. The calcuated data won't be saved but my users find it
helpful to use the grand total as a visual clue to help them catch their
data entry errors.

thanks,

rOn
 
G

Gary Miller

Ron,

The easiest way is to use a textbox in the footer of the
subform with "=Sum([YourFieldToSum])" as the control source.
To have one on the mainform you would most likely end up
using DSum() to query the underlying records for that
InvoiceID.

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
I have what I think is a pretty standard billing form. It
comprises a main
invoice form linked to an invoice details form for line
items. Each line
item ends in a total field which is itself a caculation of
[Payrate]*[Units].

I need to create a calcuated field that adds the line items
from the
subform on the fly and displays them in another field,
preferably in the
main form. The calcuated data won't be saved but my users
find it
helpful to use the grand total as a visual clue to help them
catch their
data entry errors.

thanks,

rOn
 
G

Guest

Thanks, Gary. That did the trick. The only problem is that
my sum field in the footer doesn't show up unless my
subform is in form view. I'd like the subform in dataview
but the sum field to show in the footer. Possible?
 

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