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 / New Users / July 2005

Tip: Looking for answers? Try searching our database.

Expressions for Aggregates in Reports

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JL - 28 Jul 2005 23:47 GMT
What is the best method to display in a report the minimum for a field
[square foot] that has various criteria attached [middle income] [low income]
[high income]?  I wish to have a min and max square footage for each of these
categories in my report which is grouped by completely different means (state
and home name).

JL
Ken Sheridan - 30 Jul 2005 18:48 GMT
Try this:

Add unbound text boxes for the min and max values (in report footer?).  In
the report header's Format event procedure initialise them to zero, e.g.

txtMinFootageLowIcome = 0
txtMaxFootageLowIncome = 0

In the detail section's Format event procedure assign values conditionally
to each control:

If txtMinFootageLowIncome = 0 Then
   txtMinFootageLowIncome = [square foot]
Else
   If txtMinFootageLowIncome < [square foot] Then
       txtMinFootageLowIncome = [square foot]
   Else
End If

If txtMaxFootageLowIncome = 0 Then
   txtMaxFootageLowIncome = [square foot]
Else
   If txtMaxFootageLowIncome > [square foot] Then
       txtMaxFootageLowIncome = [square foot]
   Else
End If

Do similarly for other income groups.

> What is the best method to display in a report the minimum for a field
> [square foot] that has various criteria attached [middle income] [low income]
[quoted text clipped - 3 lines]
>  
> JL
Duane Hookom - 31 Jul 2005 01:09 GMT
I wish you would have stated how the income levels are recorded... Assuming
you have a field named [IncomeLevel] with values of "M", "L", and "H".
Create a totals query by your "different means" and income level. Select one
column as the Min([Square Feet]) and one as the Max([Square Feet]). Use this
total query as the record source of a subreport placed in your main report.

Signature

Duane Hookom
MS Access MVP

> What is the best method to display in a report the minimum for a field
> [square foot] that has various criteria attached [middle income] [low
[quoted text clipped - 6 lines]
>
> JL
Ken Sheridan - 31 Jul 2005 11:37 GMT
I missed a couple of lines.  To make each min/max value conditional on the
income level you ned to wrap each block of f code in an If statement, e.g.
for low income levels, if this wewre to be indicated by a value in a text
field IncomeLevel:

If [IncomeLevel] = "Low"
   If txtMinFootageLowIncome = 0 Then
       txtMinFootageLowIncome = [square foot]
   Else
       If txtMinFootageLowIncome < [square foot] Then
           txtMinFootageLowIncome = [square foot]
       Else
   End If

   If txtMaxFootageLowIncome = 0 Then
       txtMaxFootageLowIncome = [square foot]
   Else
       If txtMaxFootageLowIncome > [square foot] Then
           txtMaxFootageLowIncome = [square foot]
       Else
   End If
End If

> What is the best method to display in a report the minimum for a field
> [square foot] that has various criteria attached [middle income] [low income]
[quoted text clipped - 3 lines]
>  
> JL
 
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.