Database Report Assistance Request

N

NorthStar

Good morning all;



I have an Access 2003 database that I use for recording my timecard
information from my job. I enter the times that I clock in and out for each
day and the period ending date. The database then calculates the number of
regular and overtime hours for each day, and the regular and overtime pay
for each day. Here is a sample of the report that I run at the end of each
pay period:





Regular
Overtime Total Hours Regular Overtime Total Earnings

Day Date Hours Hours
Earnings Earnings

Period Ending: 11/19/06

Regular Overtime Total

Total Hours:

Total Earnings:

Monday 11/06/06 5.7 0.0 5.7
$98.88 $0.00 $98.88

Tuesday 11/07/06 8.0 0.0 8.0
$139.13 $0.00 $139.13

Wednesday 11/08/06 8.0 0.4 8.4
$140.00 $10.06 $150.06

Thursday 11/09/06 8.0 0.3 8.3
$140.00 $7.00 $147.00

Friday 11/10/06 8.0 0.4
8.4 $140.00 $10.50 $150.50

Monday 11/13/06 8.0 0.0 8.0
$140.00 $0.00 $140.00

Tuesday 11/14/06 7.9 0.0 7.9
$138.83 $0.00 $138.83

Wednesday 11/15/06 8.0 0.1 8.1
$140.00 $1.31 $141.31

Thursday 11/16/06 8.0 0.0 8.0
$140.00 $0.00 $140.00

Friday 11/17/06 8.0 0.0
8.0 $140.00 $0.00 $140.00

Saturday 11/18/06 8.0 0.0 8.0
$140.00 $0.00 $140.00





As you can see, I have no problem writing the formulas in the "Master
Report - Daily Timecard (Summary)" report that calculate the number of hours
worked and the projected pay due for each day.



My problem is in the formulas that calculate the total hours and pay for
each pay period. I cannot get Access to recognize the field names for the
calculated fields (even when I use the formula builder function in the
report). Here is what I use to calculate the total number of regular hours
(I will call it Total Regular Hours):



=Sum([Regular Hours])



This sum function should give me a total of all of the hours shown in the
Regular Hours column, but it doesn't. When I run the report, I get a dialog
box where I'm supposed to enter the data for the Total Regular Hours field.



Can anyone help me? If I can get this field in the "Master Report - Daily
Timecard (Summary)" report to work, I should be able to copy the formula to
the other total fields in the report. I've uploaded a copy of this database
to the Assistance Needed folder under the name of TimeCard Database.zip.



Thanks for looking at this.
 
D

Duane Hookom

You can't sum controls (text boxes). You can generally sum the expressions
from the control sources of controls. For instance if you have a text box in
your detail section:
Name: txtNetCost
Control Source: =UnitPrice * Qty
You can't add a text box to the report footer (or header or group
header/footer) with a control source of:
Control Source: =Sum(txtNetCost)
You can use this:
Control Source: =Sum(UnitPrice * Qty)

--
Duane Hookom
Microsoft Access MVP


NorthStar said:
Good morning all;



I have an Access 2003 database that I use for recording my timecard
information from my job. I enter the times that I clock in and out for each
day and the period ending date. The database then calculates the number of
regular and overtime hours for each day, and the regular and overtime pay
for each day. Here is a sample of the report that I run at the end of each
pay period:





Regular
Overtime Total Hours Regular Overtime Total Earnings

Day Date Hours Hours
Earnings Earnings

Period Ending: 11/19/06

Regular Overtime Total

Total Hours:

Total Earnings:

Monday 11/06/06 5.7 0.0 5.7
$98.88 $0.00 $98.88

Tuesday 11/07/06 8.0 0.0 8.0
$139.13 $0.00 $139.13

Wednesday 11/08/06 8.0 0.4 8.4
$140.00 $10.06 $150.06

Thursday 11/09/06 8.0 0.3 8.3
$140.00 $7.00 $147.00

Friday 11/10/06 8.0 0.4
8.4 $140.00 $10.50 $150.50

Monday 11/13/06 8.0 0.0 8.0
$140.00 $0.00 $140.00

Tuesday 11/14/06 7.9 0.0 7.9
$138.83 $0.00 $138.83

Wednesday 11/15/06 8.0 0.1 8.1
$140.00 $1.31 $141.31

Thursday 11/16/06 8.0 0.0 8.0
$140.00 $0.00 $140.00

Friday 11/17/06 8.0 0.0
8.0 $140.00 $0.00 $140.00

Saturday 11/18/06 8.0 0.0 8.0
$140.00 $0.00 $140.00





As you can see, I have no problem writing the formulas in the "Master
Report - Daily Timecard (Summary)" report that calculate the number of hours
worked and the projected pay due for each day.



My problem is in the formulas that calculate the total hours and pay for
each pay period. I cannot get Access to recognize the field names for the
calculated fields (even when I use the formula builder function in the
report). Here is what I use to calculate the total number of regular hours
(I will call it Total Regular Hours):



=Sum([Regular Hours])



This sum function should give me a total of all of the hours shown in the
Regular Hours column, but it doesn't. When I run the report, I get a dialog
box where I'm supposed to enter the data for the Total Regular Hours field.



Can anyone help me? If I can get this field in the "Master Report - Daily
Timecard (Summary)" report to work, I should be able to copy the formula to
the other total fields in the report. I've uploaded a copy of this database
to the Assistance Needed folder under the name of TimeCard Database.zip.



Thanks for looking at this.




--
NorthStar


Always do right. This will gratify some people and astonish the rest.
 

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