Running total on report

S

Shanin

Ok I thought this was easy until I kept getting an error. I have a report
that pull off a query showing the schedule for that query and the total time
for each shift. I put a text box in the footer with running sum set to on
and with this statement:

=Sum([Total])

Total is the field name that shows the difference in the start time and end
time, but all I get is "error". Would it make any difference that the total
is in the short time format and not hundreths of an hour??
 
T

Tom Wickerath

The first thing to check is to make sure that the name of
the textbox is not the same as the name of the field
(Total). Use something like txtTotal for the name of the
control.


Tom
________________________________
 
T

Tom Wickerath

Also, I believe you will have better luck by performing the calculation for Total in the
underlying query for the report, instead of trying to use a calculated textbox on the report,
assuming that is what you are doing in the detail section. I seem to recall (??) that when I
used a calculated textbox in the detail section of a report, and then attempted to calculate a
Sum in the footer, that I also got an error. I think I solved it by adding a new textbox in the
detail section, setting it's visible property to False, and setting it's control source equal to
my calculated textbox in the same section. Then, I used:

= Sum([HiddenTextBoxName])

in the footer and it worked. It's a bit late right now for me (1:08 AM), so I don't have time to
double-check this right now. In any case, I think you'll be better off by performing the detail
level calculation for total in a query instead of trying to do it in a textbox in the report.

Tom
_________________________________


The first thing to check is to make sure that the name of
the textbox is not the same as the name of the field
(Total). Use something like txtTotal for the name of the
control.


Tom
________________________________
 
S

Shanin

The totals are calculated in the query, I was just wanting to do the running
sum on the report. I'll try putting the sum in the detail and see if that
works

Tom Wickerath said:
Also, I believe you will have better luck by performing the calculation for Total in the
underlying query for the report, instead of trying to use a calculated textbox on the report,
assuming that is what you are doing in the detail section. I seem to recall (??) that when I
used a calculated textbox in the detail section of a report, and then attempted to calculate a
Sum in the footer, that I also got an error. I think I solved it by adding a new textbox in the
detail section, setting it's visible property to False, and setting it's control source equal to
my calculated textbox in the same section. Then, I used:

= Sum([HiddenTextBoxName])

in the footer and it worked. It's a bit late right now for me (1:08 AM), so I don't have time to
double-check this right now. In any case, I think you'll be better off by performing the detail
level calculation for total in a query instead of trying to do it in a textbox in the report.

Tom
_________________________________


The first thing to check is to make sure that the name of
the textbox is not the same as the name of the field
(Total). Use something like txtTotal for the name of the
control.


Tom
________________________________
Ok I thought this was easy until I kept getting an error. I have a report
that pull off a query showing the schedule for that query and the total time
for each shift. I put a text box in the footer with running sum set to on
and with this statement:

=Sum([Total])

Total is the field name that shows the difference in the start time and end
time, but all I get is "error". Would it make any difference that the total
is in the short time format and not hundreths of an hour??
.
 
Top