Solved

How divide number on a report by a number on a subreport?

Posted on 2011-09-03
4
216 Views
Last Modified: 2012-05-12
I have a field on a report, "txtSumMoldsMade" which I want to divide by a number on a subreport, "txtCount" and show the result in a field on the main report, "txtAverage"

How?
0
Comment
Question by:SteveL13
[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
  • 2
4 Comments
 
LVL 75
ID: 36478621
You can try this in as the Control Source for txtAverage:

=[txtSumMoldsMade] / (Reports!YourReportName!YourSubReportControlName.Report!txtCount)

Of course, if txtCount can be zero, then you will get #Error ... or if the subreport does not have any records.

mx
0
 
LVL 44

Accepted Solution

by:
GRayL earned 500 total points
ID: 36481356
Actually you can shorten that a bit:

=[txtSumMoldsMade]/[srpName].Report!txtCount

where srpName is the name of the sub-report on the report
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36484629
<No points wanted>
And you can see here for a way to deal with errors of the sub has no records:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Coding-Macros/Q_24843132.html

JeffCoachman
0
 
LVL 75
ID: 36497277
Just noting that the syntax I post was correct and will work from anywhere.

mx
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
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.
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…

710 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