Solved

Passing values from subreport to main report

Posted on 2008-06-19
13
337 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
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.

 

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 - Microsoft MVP, Access and Data Platform) 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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 …

730 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