Solved

How to create a custom crosstab report

Posted on 2011-02-14
8
391 Views
Last Modified: 2012-08-13
Hello -
I am using Access 2003 to create a database to track contracts. I would like to create a report that would like to look something like this:
                                  P1        P2        P3
Expense 2010      100      120      90
Payment 2010       25        50        75
Difference            (75)    (125)  (150)  

The report would then list 2011, then 2012 below in the same format.
I have a Contract table with a unique ContractID key linking to a LineItems table in a one to many relationship. Then have ExpenseDetails table and PaymentDetails table linked to LineItems via a LineItemID field in a one to many relationship.

Does anyone have an idea how I can accomplish this? I tried crosstabs but could not get the row to subtract payments from expenses. Your help is deeply appreciated as I have been trying to resolve this for over a month now and no results. Please let me know if I need to provide additonal information to give better clarity.
Thanks,
CJ
0
Comment
Question by:cjarvis1128
[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
8 Comments
 
LVL 18

Expert Comment

by:lludden
ID: 34891944
Put in the expenses as negative values, but when you are displaying them in the report, use ABS() around them.  Then you can just sum the columns for the difference.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34891971
upload a copy of the db...
0
 

Author Comment

by:cjarvis1128
ID: 34892055
Thanks for the response. Attached is a copy of the db.
Summary.mdb
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:cjarvis1128
ID: 34898048
lludden-
Thanks. That is actually a good suggestion but there are other options which I forgot to mention that needs to be considered in the calculation. The difference is actually as below:
P1 = Payments-Expenses
P2 = P1+Payments-Expenses
P3 = P2+Payments-Expenses
and so on..
I would also like to have the three rows to appear (calculation with zero) whether there are  payments entered or not. I am not sure if doing it in a form so its editable would be an option or even easier but open to that possibility.  
The report should be able to select the contract No or Contract Name in the header and show the relevant summary.
Thanks,
CJ
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34900418
Well a crosstab query won't easily display multiple "Year" groupings for years, like you have shown above...

                                  P1        P2        P3
Expense 2010      100      120      90
Payment 2010       25        50        75
Difference            (75)    (125)  (150)

                                  P1        P2        P3
Expense 2011      100      120      90
Payment 2011       20       73        12
Difference            (80)    (47)  (78)

You may have an easier time just filtering the crosstab query for one year at a time.
0
 

Accepted Solution

by:
cjarvis1128 earned 0 total points
ID: 34910167
Thanks Boaq2000. The powers that be wants to see this format so don't have a choice. I was thinking that a possible workaround would be to export the data to an excel template and create the summary via code there.

Based on responses to date I gather that my desired setup is overly cumbersome to create and I will proceed with attempts to 'build' the above workaround.
Most definitely appreciate the feedback.
CJ
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34911219
OK

Good luck.

Jeff
0
 

Author Closing Comment

by:cjarvis1128
ID: 35115342
I created an excel link into the database and implemented a workaround. Had excellent feedback from expert members but in the end the best solution to get the desired output was the workaround.
Thanks!
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

687 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