Sum Problem

M

Martin

I have a control called TreatWeeks in the Detail section of a report. Its
ControlSource is: =Int([LOSDays]/7). This produces the desired result in
the Detail section.

In the Report Footer secion, I created a control with a ControlSource of:
=Sum([TreatWeeks]). When I run the report, I get an Enter Parameter Value
window for the TreatWeeks value. If I do not have this control in the
Footer, everything is fine.

Can someone tell me why I am getting the Parameter prompt when the control
exists in the report?

Thanks.
 
F

fredg

I have a control called TreatWeeks in the Detail section of a report. Its
ControlSource is: =Int([LOSDays]/7). This produces the desired result in
the Detail section.

In the Report Footer secion, I created a control with a ControlSource of:
=Sum([TreatWeeks]). When I run the report, I get an Enter Parameter Value
window for the TreatWeeks value. If I do not have this control in the
Footer, everything is fine.

Can someone tell me why I am getting the Parameter prompt when the control
exists in the report?

Thanks.

Repeat the actual calculation, rather than summing the [TreatWeeks]
control.
=Sum(int([LOSDays]/7))
 
M

Martin

Thanks for the response, but now the Parameter prompt appears for LOSDays.


fredg said:
I have a control called TreatWeeks in the Detail section of a report. Its
ControlSource is: =Int([LOSDays]/7). This produces the desired result in
the Detail section.

In the Report Footer secion, I created a control with a ControlSource of:
=Sum([TreatWeeks]). When I run the report, I get an Enter Parameter Value
window for the TreatWeeks value. If I do not have this control in the
Footer, everything is fine.

Can someone tell me why I am getting the Parameter prompt when the control
exists in the report?

Thanks.

Repeat the actual calculation, rather than summing the [TreatWeeks]
control.
=Sum(int([LOSDays]/7))
 
J

Jeff Boyce

Martin

Pardon my intrusion...

Spelling counts. If Access gives you a prompt, it means it doesn't
recognize the control/field name. Re-check the spelling of the field...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Martin said:
Thanks for the response, but now the Parameter prompt appears for LOSDays.


fredg said:
I have a control called TreatWeeks in the Detail section of a report.
Its
ControlSource is: =Int([LOSDays]/7). This produces the desired result
in
the Detail section.

In the Report Footer secion, I created a control with a ControlSource
of:
=Sum([TreatWeeks]). When I run the report, I get an Enter Parameter
Value
window for the TreatWeeks value. If I do not have this control in the
Footer, everything is fine.

Can someone tell me why I am getting the Parameter prompt when the
control
exists in the report?

Thanks.

Repeat the actual calculation, rather than summing the [TreatWeeks]
control.
=Sum(int([LOSDays]/7))
 
M

Martin

Intrusion is welcome. However, I have checked spelling 3 or 4 times,
compared to any reserved words, all with no result.

This might sound crazy, but it seems like the only way a Sum will work is
with a field/control directly from the record source. If there is a
calculated control that needs to be summed, Access cannot handle it.

The reason I say that is because I have other controls that are direct from
the source and the sums work. Only the one that is a calculation will not
sum.


Jeff Boyce said:
Martin

Pardon my intrusion...

Spelling counts. If Access gives you a prompt, it means it doesn't
recognize the control/field name. Re-check the spelling of the field...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Martin said:
Thanks for the response, but now the Parameter prompt appears for LOSDays.


fredg said:
On Wed, 2 Jul 2008 09:37:00 -0700, Martin wrote:

I have a control called TreatWeeks in the Detail section of a report.
Its
ControlSource is: =Int([LOSDays]/7). This produces the desired result
in
the Detail section.

In the Report Footer secion, I created a control with a ControlSource
of:
=Sum([TreatWeeks]). When I run the report, I get an Enter Parameter
Value
window for the TreatWeeks value. If I do not have this control in the
Footer, everything is fine.

Can someone tell me why I am getting the Parameter prompt when the
control
exists in the report?

Thanks.

Repeat the actual calculation, rather than summing the [TreatWeeks]
control.
=Sum(int([LOSDays]/7))
 
F

fredg

Intrusion is welcome. However, I have checked spelling 3 or 4 times,
compared to any reserved words, all with no result.

This might sound crazy, but it seems like the only way a Sum will work is
with a field/control directly from the record source. If there is a
calculated control that needs to be summed, Access cannot handle it.

The reason I say that is because I have other controls that are direct from
the source and the sums work. Only the one that is a calculation will not
sum.

Jeff Boyce said:
Martin

Pardon my intrusion...

Spelling counts. If Access gives you a prompt, it means it doesn't
recognize the control/field name. Re-check the spelling of the field...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Martin said:
Thanks for the response, but now the Parameter prompt appears for LOSDays.


:

On Wed, 2 Jul 2008 09:37:00 -0700, Martin wrote:

I have a control called TreatWeeks in the Detail section of a report.
Its
ControlSource is: =Int([LOSDays]/7). This produces the desired result
in
the Detail section.

In the Report Footer secion, I created a control with a ControlSource
of:
=Sum([TreatWeeks]). When I run the report, I get an Enter Parameter
Value
window for the TreatWeeks value. If I do not have this control in the
Footer, everything is fine.

Can someone tell me why I am getting the Parameter prompt when the
control
exists in the report?

Thanks.

Repeat the actual calculation, rather than summing the [TreatWeeks]
control.
=Sum(int([LOSDays]/7))

You are not summing a calculated control.
That control in the Detail Section was called [TreatWeeks].
This is a different unbound control in the Report Footer.
It uses the same expression used in [TreatWeeks] but wraps it in the
Sum() function. If [TreatWeeks] gives you the correct individual
values, then this new expression should give you the Sum of those
individual values.

Is [LOSDays] a NUMBER datatype field?
Does it contain decimal values?

You can place this control in any report footer EXCEPT in the PAGE
Footer.

It works for me.
 
M

Martin

I have only one report footer. The LOSDays is a calculation based on two
dates also in the Detail section. One of those dates is an IF statement that
will contain either a date from the record source or a fixed date entered by
the user.

Thanks.


fredg said:
Intrusion is welcome. However, I have checked spelling 3 or 4 times,
compared to any reserved words, all with no result.

This might sound crazy, but it seems like the only way a Sum will work is
with a field/control directly from the record source. If there is a
calculated control that needs to be summed, Access cannot handle it.

The reason I say that is because I have other controls that are direct from
the source and the sums work. Only the one that is a calculation will not
sum.

Jeff Boyce said:
Martin

Pardon my intrusion...

Spelling counts. If Access gives you a prompt, it means it doesn't
recognize the control/field name. Re-check the spelling of the field...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Thanks for the response, but now the Parameter prompt appears for LOSDays.


:

On Wed, 2 Jul 2008 09:37:00 -0700, Martin wrote:

I have a control called TreatWeeks in the Detail section of a report.
Its
ControlSource is: =Int([LOSDays]/7). This produces the desired result
in
the Detail section.

In the Report Footer secion, I created a control with a ControlSource
of:
=Sum([TreatWeeks]). When I run the report, I get an Enter Parameter
Value
window for the TreatWeeks value. If I do not have this control in the
Footer, everything is fine.

Can someone tell me why I am getting the Parameter prompt when the
control
exists in the report?

Thanks.

Repeat the actual calculation, rather than summing the [TreatWeeks]
control.
=Sum(int([LOSDays]/7))

You are not summing a calculated control.
That control in the Detail Section was called [TreatWeeks].
This is a different unbound control in the Report Footer.
It uses the same expression used in [TreatWeeks] but wraps it in the
Sum() function. If [TreatWeeks] gives you the correct individual
values, then this new expression should give you the Sum of those
individual values.

Is [LOSDays] a NUMBER datatype field?
Does it contain decimal values?

You can place this control in any report footer EXCEPT in the PAGE
Footer.

It works for me.
 

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