Highest value on report

S

s4

Hi, I have a report with textboxes that dlookup, davg, dmax and dmin values
from a couple of tables. I have about 5 dmax ones from different fields, so
it's like a high score style thing, though they aren't ordered in ascending
order, so is there a way to make a label saying 'HIGHEST' next to the textbox
with the highest amount. Basically I need to determine which text box on the
report has the greatest value so that it can be highlighted. Any way to do
this?

Thanks
 
A

Al Campagna

Use the OnFormat event of the section that contains the 5 calculations. (ex.
fields T1, T2, T3, T4, T5)
This woukd be a "brute force" method...
If T1 > T2 And T1 > T3 And T1>T4 And T1 > T5 Then
' highlight the T1 control
ElseIf T2 > T1 And T2 > T3 .... T2 > T5 Then
' highlight the T2 control
ElseIf.... etc for all possibilities
..
..
End If

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top