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 / November 2004

Tip: Looking for answers? Try searching our database.

count the number of Groupings

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DWJ - 12 Nov 2004 19:08 GMT
Need the =Count in report header to count the number of groupings produced.
Marshall Barton - 13 Nov 2004 17:19 GMT
>Need the =Count in report header to count the number of groupings produced.

Place a text box named txtGrpCount in the group header or
footer.  Set its control source expression to =1 and its
RunningSum to Over All.

You can display the total number of groups in the report
footer section by using a text box with the expression:
    =txtGrpCount
but that's not what you wanted, so ignore that.

To get the total in the report header, you first have to
force the report to be formatted twice.  This can be done
easily by using a text box that references the Pages
property (e.g. =Page & " of " & Pages).

Now, add a module level declaration to the report's class
module:
    Private lngTotalGroups As Long

Add a line of code to the report footer section's Format
event procedure to save the end result of the running sum
text box to the variable:
    lngTotalGroups = Me.txtGrpCount

Also add a line of code to the report header section's
Format event to copy the total to the report header text
box:
    Me.txtHdrGroupTotal = lngTotalGroups

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.