• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 312
  • Last Modified:

How make largest calculated value in detail section of report print in footer section

I have a report that has a calculated number value in each record on the report.  In the footer section of the report I want to print the largest of the detail values.  Just the one largest value.  How can I do this?

--Steve
0
SteveL13
Asked:
SteveL13
  • 4
  • 2
  • 2
  • +2
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Assuming the calculation in the the query driving the report, create a text box in the Footer

Control Source:

=DMax([YourCalcFieldName])

mx
0
 
Rey Obrero (Capricorn1)Commented:
you can try dmax with a domain

=dmax("[calculatedfield]","queryName")

"queryName" is the name of the Record Source of the report
0
 
SteveL13Author Commented:
The first suggestion does not work.  The second one only gives me the last calculated value from the detail section.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
And actually, make the Control Source of the text box


=Max([YourCalcFieldName])

not DMax()

And using the method will take into account any filtering that may occur when the report open.  Getting DMax() from the query will not.

mx
0
 
Rey Obrero (Capricorn1)Commented:
how do you do the calculation ?
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
SteveL13:  try my post @ http:#a36965549

mx
0
 
Dale FyeCommented:
is this a continuous form, or a single form?
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
It's a report ...
0
 
Nick67Commented:
Me being me, I'd code it

Public TheBiggest as Single 'or double or integer or whatever

Then in the ReportOpen()
TheBiggest=0

Then in the Detail_Format()
if WhateverYouAreCalculating > TheBiggest then
     TheBiggest = WhateverYouAreCalculating
end if  


And finally in whatever section you want to display it
Me.SomeControlValue = TheBiggest

You might be able to muck with some control value to get it to work--and that might be more elegant.
This will work, and you can understand how it works--which is why I'd do it this way
0
 
SteveL13Author Commented:
This worked perfectly.  Thanks.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 4
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now