Solved

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

Posted on 2011-09-03
4
209 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
vba DCount with 2 criteria 3 34
Field behavior for "locked" form 12 29
sort Time by AM and PM in query 2 18
Search Form with Run Time Error 3075 1 22
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…
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 Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
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…

919 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

17 Experts available now in Live!

Get 1:1 Help Now