Solved

Passing values from subreport to main report

Posted on 2008-06-19
13
333 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
ID: 21825213
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 21825220
0
 
LVL 11

Expert Comment

by:RgGray3
ID: 21825285
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
ID: 21825397
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
ID: 21825424
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
ID: 21825431
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
ID: 21826237
" 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
ID: 21826298
report/ subreport
0
 
LVL 75
ID: 21826339
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
ID: 21826447
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
ID: 21826545
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
ID: 21826655
Thanks!
0
 
LVL 75
ID: 21826659
you are welcome.

mx
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

895 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

15 Experts available now in Live!

Get 1:1 Help Now