Grouping records in reports

ChristopherM

Registered User.
Local time
Today, 10:24
Joined
Jan 5, 2000
Messages
38
I would like to group records in a report by a predetermined number so after every say 5 or 10 lines the group header (and footer) would be printed but I cannot find a way of doing this without put a number column in the underlying table and printing the report in this number sequence. Can anyone help?
 
This is one of those "Creative" ideas.

First you can't use the conventional header/footer, but you can do the next best thing.

First add to the top of your details section text boxes (not labels to match the header fields) Do the same for the Footer (adding them to the bottom of course. Now make sure their CanShrink Property is set to True( or Yes). Now Each of these fields control source should be left blank (Unbound). On the first field in the header make its control source this: = GetRowNumber()

Now goto the Code of the report.

In the Details section add this:

Private iCount as Integer

Add this Function:

Private Function GetRowNumber()
If iCount = 0 Then
GetRowNumber = "First Fields Text"
Me.HeaderField2 = "Second Fields Text"
Me.FooterField1 = "First Footer Field Text/Value"
Me.FooterField2 = "Second Footer Field Text/Value"
iCount = iCount + 1
ElseIf iCount = 9 Then
iCount = 0
Else
iCount = iCount + 1
End If

End Function

This will count Through and add the Header/Footer every 10th time.

Hope this is helpful
 

Users who are viewing this thread

Back
Top Bottom