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

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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" wrote:

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" wrote:

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
'====================================================


Shawna wrote:
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" wrote:

"Shawna" <Shawna@xxxxxxxxxxxxxxxxxxxxxxxxx>
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




.



Relevant Pages

  • RE: Why cant I open a report using VB?
    ... You'll also get a message box telling you the value of the txtID control - ... Run the query to see if it returns any records. ... know that the query is fine, and so is the data that the report is based on. ... intTestID = Forms!frmDrive!Text35.Value ...
    (microsoft.public.access.modulesdaovba)
  • RE: Why cant I open a report using VB?
    ... Right, plugging the number into the criteria works, so the query itself is ... "Stuart At Work" wrote: ... know that the query is fine, and so is the data that the report is based on. ... is to check that the control that you refer to to populate the variable ...
    (microsoft.public.access.modulesdaovba)
  • RE: Filter Query by Year on a form
    ... If the check box does not affect what data are retrieved by the query, ... launch several different reports. ... it will launch that particular report say material cost report or ... If the user enters a year in the from year control and nothing in the to ...
    (microsoft.public.access.queries)
  • Re: Change of field name causes application to crash
    ... I can create a simple Sum query and get the same crash. ... UNION ALL query to simply UNION. ... > are part of the report. ... Sometimes when you have a control ...
    (microsoft.public.access.modulesdaovba)
  • RE: Report weirdness....
    ... My query works fine, Joseph - it's the report based on the query I'm getting ... I've tried removing JUST the control involved, & the report works fine. ... "Duane Hookom" wrote: ...
    (microsoft.public.access.reports)