Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question 1: A box that totals several fields from a subform?

Status
Not open for further replies.

yogi71

Technical User
Apr 5, 2013
13
US
I have a form, frmSubmitTime.
It has a subform, frmTimeSheetReview which is a Datasheet.
In subTimeReview are columbs, Name, Site, WeekEndDate, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday

I want to put a field on frmSubmitTime that takes the values of Sunday, Monday-Saturday and adds them up. The datasheet contains multiple rows and only shows the WeekEndDate that was established in a previous form, that variable was passed to this form upon open.

I had originally thought, if I put the "default value" or the "control source" to the following, it would work.
Code:
=[frmTimeSheetReview].[Form]![Sunday]+[frmTimeSheetReview].[Form]![Monday]+[frmTimeSheetReview].[Form]![Tuesday]+[frmTimeSheetReview].[Form]![Wednesday]+[frmTimeSheetReview].[Form]![Thursday]+[frmTimeSheetReview].[Form]![Friday]+[frmTimeSheetReview].[Form]![Saturday]

Alas, it did not.

What am I doing wrong? Is it even possible? I'm rusty with Access, and having to relearn waay to much in a short time.
 
In case anyone finds this post for an answer....since no one answered....

I built a seperate query that did a Sum on each of the Day of Week fields by user and weekEnd date. So it totaled all of Sunday for each week for each user, and all of Monday...etc.

Then, in the Query builder of the form, I used Sum(Nz[Sum of Sunday]+Nz[Sum of Monday]+etc....)

Works just like I expected.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top