Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / January 2007

Tip: Looking for answers? Try searching our database.

Text Box Calculation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
caseyalta - 29 Jan 2007 16:46 GMT
I have 3 textboxes on a report that total number of unit sales between
specific dates. I want to add a textbox and have it calculate the highest
number of the other 3 to use in another calculation
Marshall Barton - 29 Jan 2007 17:40 GMT
>I have 3 textboxes on a report that total number of unit sales between
>specific dates. I want to add a textbox and have it calculate the highest
>number of the other 3 to use in another calculation

=IIf(t1 > IIf(t2 > t3, t2, t3), t1, IIf(t2 > t3, t2, t3))

That kind of expression gets very messy very quickly, so
it's almost always better to create a function to do the
calculation:

Public Function MaxOfList(ParamArray vValues() As Variant)
As Variant
Dim vX As Variant

   MaxOfList = vValues(0)
   For Each vX In vValues
       If vX >= Nz(MaxOfList, vX) Then MaxOfList = vX
   Next vX
End Function

Signature

Marsh
MVP [MS Access]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.