accumulated hours

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am accumulating hours for individual clients and when the second page is
referenced the record on the previous page is counted again on the new page.
The code on the detail section format that i am using is

dblhours = dblhours + IIf(Me!activity_desc = "Admission Eval. [Diag]",
Me.txtUnboundHours, Me.txtHours)

thus my sum at the end of the group is off by 1.5 or 2 or whatever the
amount is that is counted twice. This does not happen for those who are only
on one page. Their totals are correct. Thanks.
 
Why are you using code to sum values? Have you tried bound expressions in
text boxes like:
=Sum(IIf([Activity_Desc]="Admission Eval. [Diag]",valueA, valueB))
 
originally the code reflected that sum([hours]) but then a manager decided
that if it is an admission eval an extra hour needs to be added via the
report. This addition is not reflected in the query field. So I am left
with making a report report raw data plus extra.

Duane Hookom said:
Why are you using code to sum values? Have you tried bound expressions in
text boxes like:
=Sum(IIf([Activity_Desc]="Admission Eval. [Diag]",valueA, valueB))

--
Duane Hookom
MS Access MVP


seeker53 said:
I am accumulating hours for individual clients and when the second page is
referenced the record on the previous page is counted again on the new
page.
The code on the detail section format that i am using is

dblhours = dblhours + IIf(Me!activity_desc = "Admission Eval. [Diag]",
Me.txtUnboundHours, Me.txtHours)

thus my sum at the end of the group is off by 1.5 or 2 or whatever the
amount is that is counted twice. This does not happen for those who are
only
on one page. Their totals are correct. Thanks.
 
According to your specifications, the following should work:
=Sum(IIf([Activity_Desc]="Admission Eval. [Diag]", [Hours]+1, [Hours]))
or
=Sum([Hours]+ Abs([Activity_Desc]="Admission Eval. [Diag]"))



--
Duane Hookom
MS Access MVP
--

seeker53 said:
originally the code reflected that sum([hours]) but then a manager decided
that if it is an admission eval an extra hour needs to be added via the
report. This addition is not reflected in the query field. So I am left
with making a report report raw data plus extra.

Duane Hookom said:
Why are you using code to sum values? Have you tried bound expressions in
text boxes like:
=Sum(IIf([Activity_Desc]="Admission Eval. [Diag]",valueA, valueB))

--
Duane Hookom
MS Access MVP


seeker53 said:
I am accumulating hours for individual clients and when the second page
is
referenced the record on the previous page is counted again on the new
page.
The code on the detail section format that i am using is

dblhours = dblhours + IIf(Me!activity_desc = "Admission Eval.
[Diag]",
Me.txtUnboundHours, Me.txtHours)

thus my sum at the end of the group is off by 1.5 or 2 or whatever the
amount is that is counted twice. This does not happen for those who
are
only
on one page. Their totals are correct. Thanks.
 
Back
Top