Access 2003 - Only showing First page of a Group

Jcase

Registered User.
Local time
Today, 08:54
Joined
Sep 23, 2008
Messages
40
I hate being such a beginner, I have a lot of questions because I am working on my first project that involves manipulating reports.

Is there a way to only show the first page of each group? I have a report that is grouped up on station, since the data is already aggregated I don't need the page to show up multiple times for each entry.
 
Last edited:
I assume that you are using a query to generate the report.

Depending on the query you are using go in to SQL view and after the 'SELECT' keyword add 'DISTINCT' or 'DISTINCTROW' depending on the query and you will not get repeated entries.

It is very useful

Cheers
John
 
I assume that you are using a query to generate the report.

Depending on the query you are using go in to SQL view and after the 'SELECT' keyword add 'DISTINCT' or 'DISTINCTROW' depending on the query and you will not get repeated entries.

It is very useful

Cheers
John

Thank you very much for the reply John, unfortunately I wasn't detailed enough in my original post. Sorry for that!

My report is grouped by StationID(Whole Group, Each value) - Each station has multiple transactions (1705 total for the month I'm running). My detail section contains a lot of unbound boxes using Dlookup to populate.

All the information I need for each station will be shown on the first page of the grouping, but access prints a page for each row in the source table.

Fortunately I stumbled across this brilliant piece of code :

Code:
'************ Code Start *************
' This code was originally written by James H Brooks.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' James H Brooks
'

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)

Dim i As Integer, m As Integer
If Me.Pages = 0 Then
ReDim Preserve GrpArrayPage(Me.Page + 1)
ReDim Preserve GrpArrayPages(Me.Page + 1)
GrpNameCurrent = Me!StationId
If GrpNameCurrent = GrpNamePrevious Then
GrpArrayPage(Me.Page) = GrpArrayPage(Me.Page - 1) + 1
GrpPages = GrpArrayPage(Me.Page)
For i = Me.Page - ((GrpPages) - 1) To Me.Page
GrpArrayPages(i) = GrpPages
Next i
Else
GrpPage = 1
GrpArrayPage(Me.Page) = GrpPage
GrpArrayPages(Me.Page) = GrpPage
End If
Else


End If
If GrpArrayPage(Me.Page) >= 2 Then  ' I added this
End If

GrpNamePrevious = GrpNameCurrent
End Sub
I've added the
Code:
if GrpArrayPage(Me.Page)>=2 Then

End If
The code grabs the page numbers for each group, so the statement I added pulls the 2nd-Last page of each group and does something.

Essentially I want that something to say "DON'T SHOW OR PRINT THIS PAGE"

Would anyone know the syntax for that?

This should be my last question for a while. :)
 
Last edited:
RESOLVED!

I put the code I posted above into the Detail_Format subroutine, in that if statement I put 'Me.PrintSection = False'

Thanks guys!
 

Users who are viewing this thread

Back
Top Bottom