Subforms

S

Squid

I have a simple Main Form with a subform. The Main Form
displays project information. The subform details the men
working on that project and the hours they worked. I want
to display a total hours worked on the form per project.

How do I sum the hours being displayed on the subform and
display it on the main form?

Thanks
Mike
 
A

Allen Browne

See:
Calculating elapsed time
at:
http://allenbrowne.com/casu-13.html

The article explains how to create a calculated field in a query to get the
number of minutes worked. You can then place a text box in the Form Footer
section of your subform, and give it these properties:
Name txtTotalMinutes
Format General Number
Control Source =Sum([Minutes])

Then on your main form, you can pick up this value by setting the Control
Source of a text box to:
=[NameOfYourSubFormControlHere].[Form]![txtTotalMinutes

The article explains how to display that as hours and minutes if desired.
 

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