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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating a total of hours worked in a report

Status
Not open for further replies.

lagg

Technical User
Oct 14, 2002
111
IE
Hi I havea rport which generates custumer name, technician name, start time, end time and hours worked. i want to display on the report a text box that displays the total hours worked by the technician. I tried =Sum([hours_worked]), but that gives me an error. Where am I going wrong
 
Is the textbox (unbound) in the report footer?
Also, use the Nz-function for NonZero values in your sum. For example:
=Nz(Sum([GrossWeightKG]))

Pampers [afro]
You never too young to learn
 
Yes, the text box is unbound in the report footer. What does the non zero value refer to?
 
lagg,

Is [hours_worked] a calculated control?? You can't sum a calculated control, but you can have Access do it for you.

Add another text box to your detail section with the same control source as [hours_worked], but set its Running Sum property to Over All and its Visible property to No.

Add a text box to your report footer and set its control source to be the text box you just added above. This will show the last running sum value from your detail section.

Si hoc legere scis, nimis eruditionis habes
 
If [hours_worked] is a numeric field in your report's record source, you shouldn't have any trouble using
=Sum([hours_worked])
in a report or group header or footer. This assumes the name of the control is not hours_worked.

If hours_worked is a calculation like =[RegHrs]+[OTHrs] then you should be able to use something like:
=Sum([RegHrs]+[OTHrs])

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
If you use Nz in your formula, it will still work even if there are Null-values in the sum.

Pampers [afro]
You never too young to learn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top