Solved

sharing data between reports

Posted on 2011-09-13
6
334 Views
Last Modified: 2012-05-12
I am trying to have the totals from one report show up on another report. Cant seem to get it.

I would like the "Forecast total" from the "Project Margins  Details" report to show up on the "Project Dashboard" report under the forecast cost for each project.  I have attached a sample file.

Also can you tell me where the item is that is causing the error message when you open the file Projects.accdb
0
Comment
Question by:SMP319
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
6 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36530662
This depends on how/when/under what circumstances these two report will be displayed.


In a Brute force scenario you could store the first value in a Public variable.
This simply insert this variable into the second report (via a function.)
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36530703
In your case you can display this total in a control anywhere you like by using the following formula as a textbox Control source

=DSum("Total","[Project Margins Details]")
0
 
LVL 1

Author Comment

by:SMP319
ID: 36530815
this only partiallyt solved my issue. It is pulling the total from the project margin report. I want the total for each individual project. can this be modified to add that criteria?
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36531076
Sure, but you logic for doing this is flawed.

Your ultimate goal here is to include (at some level) the same source into the other report.

Meaning you really should not have to rely on "grabbing" a value form one report and inserting it into another.

For example, ...you need Total sales per employee for New York in one report.
Great, you create a report to show that.

Now you need this same data in a Nationwide Report (All States).

In this case your goal should not be to "get" the data from the first report and insert it into the second report.
Instead the same source or "RecordSource", (again at some level) should be used for both reports.
This way you create the report the same way
Make sense?


But to answer your question directly;...Yes, you can add criteria to the Dsum like so:
=DSum("Total","[Project Margins Details]", "State=" & "'" & New York & "'")
...for a sum from NY (text)
Or
=DSum("Total","[Project Margins Details]", "EmpID=" & me.empID)
...for the sum for a selected EmployeeID (Numeric)
You can see the help files on "Aggregate Functions", for more in depth information.

Some issues with using aggregate functions are that:
1. They use more resources that doing this through the Recordsource
2. They can get very complex to write as you include multiple criterion that include Numbers, Text and dates)

JeffCoachman



0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36531112
BTW, the error is caused because you set an opening form ("Project List") in the Access option, but that form has either been renamed or deleted.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 36531275
...so in your case this would be what you could use for "Test Project"

=DSum("Total","[Project Margins Details]","Project=" & 4)

Finally, (and as a side note) I strongly advise you avoid using "Lookup Fields" in your tables.
There are many reasons:
http://access.mvps.org/access/lookupfields.htm
(Use lookups in your forms only)

...But in your case specifically it just makes it that much more difficult to see what the real underlying value is (4, not "Test Project")

JeffCoachman
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question