Total Calculated Time

P

Pam

I have a text box (TotalManufacturingForTech) on a subreport
(rSubreportDailyWorkManufacturing) on Main Form (DailyWork). The
calculation for the text box is as follows:

=Sum(DateDiff("n",[StartTime],[StopTime]))\60 & ":" &
Format(Sum(DateDiff("n",[StartTime],[StopTime])) Mod 60,"00")

I have a hidden text box in the detail section of the main form with
following code:

=IIf(rSubreportDailyWorkManufacturing.Report.HasData=True,rSubreportDailyWorkMnaufacturing.Report!TotalManufacturingForTech,0)

I also have the same subreport, text box on subreport and hidden text box in
the detail section of main for with same codes for Repair (substitute
Manufacturing for Repair). Everything works great. Now I need to total the
two subreports to get a total for Manufacturing time and for Repair time on
this main report. I've struggled with this for some time now and nothing
works - get lots of #Error msgs. Any help is greatly appreciated! Thanks,
Pam
 
M

Marshall Barton

Pam said:
I have a text box (TotalManufacturingForTech) on a subreport
(rSubreportDailyWorkManufacturing) on Main Form (DailyWork). The
calculation for the text box is as follows:

=Sum(DateDiff("n",[StartTime],[StopTime]))\60 & ":" &
Format(Sum(DateDiff("n",[StartTime],[StopTime])) Mod 60,"00")

I have a hidden text box in the detail section of the main form with
following code:

=IIf(rSubreportDailyWorkManufacturing.Report.HasData=True,rSubreportDailyWorkMnaufacturing.Report!TotalManufacturingForTech,0)

I also have the same subreport, text box on subreport and hidden text box in
the detail section of main for with same codes for Repair (substitute
Manufacturing for Repair). Everything works great. Now I need to total the
two subreports to get a total for Manufacturing time and for Repair time on
this main report. I've struggled with this for some time now and nothing
works - get lots of #Error msgs. Any help is greatly appreciated! Thanks,


Since the subreport textbox has been converted to a nicely
formatted text string, you can not calculate a total using
that text box. Use a hidden text box named txtSubTotal in
the subreport with the expression:
=Sum(DateDiff("n",[StartTime],[StopTime]))
Then change the TotalManufacturingForTech text box that
displays the formatted value to use the expression:
=txtSubTotal \ 60 & ":" & Format(txtSubTotal Mod 60,"00")

Now your hidden text box (let's name it txtRunSubTotal) on
the main report would use the expression:
=IIf(rSubreportDailyWorkManufacturing.Report.HasData,
rSubreportDailyWorkMnaufacturing.Report!txtSubTotal, 0)

You can now calculate the grand total in the report footer
by first setting txtRunSubTotal text box's RunningSum
property to Over All. Then use the expression:
=txtRunSubTotal
in the report footer footer text box that displays the grand
total.
 
P

Pam

Marsh, Thank you so much for the solution to this frustrating problem. I
was able to use the formulas you gave and add three subreports to my main
report and have totals for each and combined. Thanks again, Pam
Marshall Barton said:
Pam said:
I have a text box (TotalManufacturingForTech) on a subreport
(rSubreportDailyWorkManufacturing) on Main Form (DailyWork). The
calculation for the text box is as follows:

=Sum(DateDiff("n",[StartTime],[StopTime]))\60 & ":" &
Format(Sum(DateDiff("n",[StartTime],[StopTime])) Mod 60,"00")

I have a hidden text box in the detail section of the main form with
following code:

=IIf(rSubreportDailyWorkManufacturing.Report.HasData=True,rSubreportDailyWorkMnaufacturing.Report!TotalManufacturingForTech,0)

I also have the same subreport, text box on subreport and hidden text box
in
the detail section of main for with same codes for Repair (substitute
Manufacturing for Repair). Everything works great. Now I need to total
the
two subreports to get a total for Manufacturing time and for Repair time
on
this main report. I've struggled with this for some time now and nothing
works - get lots of #Error msgs. Any help is greatly appreciated! Thanks,


Since the subreport textbox has been converted to a nicely
formatted text string, you can not calculate a total using
that text box. Use a hidden text box named txtSubTotal in
the subreport with the expression:
=Sum(DateDiff("n",[StartTime],[StopTime]))
Then change the TotalManufacturingForTech text box that
displays the formatted value to use the expression:
=txtSubTotal \ 60 & ":" & Format(txtSubTotal Mod 60,"00")

Now your hidden text box (let's name it txtRunSubTotal) on
the main report would use the expression:
=IIf(rSubreportDailyWorkManufacturing.Report.HasData,
rSubreportDailyWorkMnaufacturing.Report!txtSubTotal, 0)

You can now calculate the grand total in the report footer
by first setting txtRunSubTotal text box's RunningSum
property to Over All. Then use the expression:
=txtRunSubTotal
in the report footer footer text box that displays the grand
total.
 

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