I need to add two text boxes from two different reports.

S

Shawna

I am adding a value from one monthly report to another monthly report. I
keep getting #name. Please help!
 
E

Evi

Shawna said:
I am adding a value from one monthly report to another monthly report. I
keep getting #name. Please help!

Give us a few more details. What are you typing into your text boxes? You
can't actually add up things in 2 different reports - reports are just ways
of showing data - I'm guessing that you are really adding up things from a
table. A common cause of the #name error is when you are trying to refer to
a control in say a form and you type the name of the form wrongly.

Evi

Evi
 
S

Shawna

In one report, the box is the total of hours in the report, the second report
is the same. I need to add the hours from both reports and include it in
another text box. Here is the expression that I am using (all is spelled
correctly)
=([TotalHoursForwardNov])+(Reports![Service Records October
2007]!TotalUnusedHoursOct)
 
J

John Spencer

I would not attempt to do it this way. It may be impossible, but for
starters, both reports would have to be open for you to get a value from
another report.

A better way would be to use a DSum statement that gets the value you
need from the underlying query of Service Records October 2007 report.
Since I have zero idea of what that underlying query or table might be I
can't give you any more detailed advice.



'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

In one report, the box is the total of hours in the report, the second report
is the same. I need to add the hours from both reports and include it in
another text box. Here is the expression that I am using (all is spelled
correctly)
=([TotalHoursForwardNov])+(Reports![Service Records October
2007]!TotalUnusedHoursOct)

Evi said:
Give us a few more details. What are you typing into your text boxes? You
can't actually add up things in 2 different reports - reports are just ways
of showing data - I'm guessing that you are really adding up things from a
table. A common cause of the #name error is when you are trying to refer to
a control in say a form and you type the name of the form wrongly.

Evi

Evi
 
S

Shawna

So should I create the dsum expression in the query I am using for the
reports? I tried to sum the two records but it is not working in the query.
I need to sum my office hours with my phone hours. Then the result of that
needs to be added to the same result every month. I have created a query for
every month. All this from one table.

John Spencer said:
I would not attempt to do it this way. It may be impossible, but for
starters, both reports would have to be open for you to get a value from
another report.

A better way would be to use a DSum statement that gets the value you
need from the underlying query of Service Records October 2007 report.
Since I have zero idea of what that underlying query or table might be I
can't give you any more detailed advice.



'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

In one report, the box is the total of hours in the report, the second report
is the same. I need to add the hours from both reports and include it in
another text box. Here is the expression that I am using (all is spelled
correctly)
=([TotalHoursForwardNov])+(Reports![Service Records October
2007]!TotalUnusedHoursOct)

Evi said:
"Shawna" <[email protected]>
I am adding a value from one monthly report to another monthly report. I
keep getting #name. Please help!
Give us a few more details. What are you typing into your text boxes? You
can't actually add up things in 2 different reports - reports are just ways
of showing data - I'm guessing that you are really adding up things from a
table. A common cause of the #name error is when you are trying to refer to
a control in say a form and you type the name of the form wrongly.

Evi

Evi
 
K

Klatuu

The DSum should be in the report, not in the query.

Also you do not need a query for each month. You are creating yourself a
maintenance nightmare. A better way is to determine the month you want the
report for and use that in the DSum's criteria argument. Since I don't know
your data or your report, I can't give an exact solution, but let's say for
example purposes you have a text box control on your report that contains the
month for the report in numeric format (1 = Jan, 2 = Feb, etc) Use the
control source of the text box you want to put the value in:

=DSum("[SomeField]", "ATableOrQuery", "Month([DateField]) = " &
Me.txtReportMonth
--
Dave Hargis, Microsoft Access MVP


Shawna said:
So should I create the dsum expression in the query I am using for the
reports? I tried to sum the two records but it is not working in the query.
I need to sum my office hours with my phone hours. Then the result of that
needs to be added to the same result every month. I have created a query for
every month. All this from one table.

John Spencer said:
I would not attempt to do it this way. It may be impossible, but for
starters, both reports would have to be open for you to get a value from
another report.

A better way would be to use a DSum statement that gets the value you
need from the underlying query of Service Records October 2007 report.
Since I have zero idea of what that underlying query or table might be I
can't give you any more detailed advice.



'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

In one report, the box is the total of hours in the report, the second report
is the same. I need to add the hours from both reports and include it in
another text box. Here is the expression that I am using (all is spelled
correctly)
=([TotalHoursForwardNov])+(Reports![Service Records October
2007]!TotalUnusedHoursOct)

:

"Shawna" <[email protected]>
I am adding a value from one monthly report to another monthly report. I
keep getting #name. Please help!
Give us a few more details. What are you typing into your text boxes? You
can't actually add up things in 2 different reports - reports are just ways
of showing data - I'm guessing that you are really adding up things from a
table. A common cause of the #name error is when you are trying to refer to
a control in say a form and you type the name of the form wrongly.

Evi

Evi
 

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