Solved

Passing values from subreport to main report

Posted on 2008-06-19
13
334 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 21825213
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

Suggested Solutions

Title # Comments Views Activity
I suddenly cannot write to C drive 20 72
VBA script to check for duplicate primary keys on lost focus 18 29
Access query expression 6 20
Should I keep recordsets open? 3 23
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

813 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

19 Experts available now in Live!

Get 1:1 Help Now