Solved

Passing values from subreport to main report

Posted on 2008-06-19
13
330 Views
Last Modified: 2013-11-28
I have developed a main form with several sub forms to pull together cost data for a job.
Specifically, the subreports include labor cost, parts cost, invoice totals, etc.

When, I try to pass the subtotal value to the main report, I get #name? error message.  I have successfully created 2 other similar reports so I am really lost.

I have tried moving the subreports to different locations within the main report with the same result each time
0
Comment
Question by:CindySt
  • 5
  • 4
  • 2
  • +1
13 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
0
 
LVL 11

Expert Comment

by:RgGray3
Comment Utility
One good paper on referencing controls on forms and subforms is located at   http://support.microsoft.com/kb/209099

But the best reference can be found at

http://www.everythingaccess.com/tutorials.asp?ID=Referring-to-properties-and-controls-from-a-form%2Freport

Trick is to create the totals in the footer of the form and set a control on the main form to be equal to the control in the footer that has the value

0
 

Author Comment

by:CindySt
Comment Utility
I said form/ subform, when I really meant report/ subreport.

I had Microsoft article 208835.  I am doing exactly what it says and still no luck.
0
 
LVL 11

Expert Comment

by:RgGray3
Comment Utility
You can download an excellant copy of the doc here

http://www.mvps.org/access/downloads/Syntax_for_subs.zip

What can I say about this doc...
I have been using Access since Version 1.1....  I always keep a copy handy...

rich
0
 

Author Comment

by:CindySt
Comment Utility
There are 5 sub reports.  Each query for the sub reports is matching the job cost in the main report.  Could there just be too many things running at once.

In main report:  Query asks [Enter Work Order number]

Each query in all subreports using the report control WOnumber to run the data.

I have made sure that the totals are in the sub report footer.  What am I missing?
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
" I have developed a main form with several sub forms to pull together cost data for a job.
Specifically, the subreports include labor cost, parts cost, invoice totals, etc."

Sub Forms or Sub Reports ?  Which is it?

mx
0
 

Author Comment

by:CindySt
Comment Utility
report/ subreport
0
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
Sorry, I missed that post.

"When, I try to pass the subtotal value to the main report,"

How are you 'passing' the subtotal value(s) ?

mx
0
 

Author Comment

by:CindySt
Comment Utility
Subtotal field in Report Footer:  txtInvoiceTotal= sum([InvoiceAmt])
where InvoiceAmt is in the detail section

In the main report a text box with:
[rptInvoiceSub].[Report]!.[txtInvoiceTotal]
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 500 total points
Comment Utility
You have and extra symbol (!) below

[rptInvoiceSub].[Report]!.[txtInvoiceTotal]
                                     ^

try this:

=[rptInvoiceSub].[Report].[txtInvoiceTotal]

and you need the equals sign also ...

mx
0
 

Author Comment

by:CindySt
Comment Utility
Thanks!
0
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
you are welcome.

mx
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now