Print a "Continued" message in Repeating Group Header Section

RHubbard

Registered User.
Local time
Today, 13:07
Joined
Dec 25, 2001
Messages
47
I have a report with multiple columns. The REPEAT SECTION property of the Group Header is set to "Yes" (so it repeats when there are more detail records than there is space in the column).

This is a nice feature but I am constantly replying to complaints from report users who claim data is missing. This complaint is ALWAYS caused by folks not being aware that there are preceeding Group Headings.

How can I include a message (something like"(Continued)") in each repeating header section? I suspect there MUST be some VBA code I could use in the ON FORMAT event of the Group Header, Yes?

Thanks for the help.

Rick
 
1) http://support.microsoft.com/?kbid=207624 has some code

2) this is what i use, got it from a forum not sure which one though.

make a grouping for the field you want. and on the on print event of the grouping put this code in:

Private Sub GroupHeader0_Print(Cancel As Integer, PrintCount As Integer)
bContinuedSection = (sLastHeaderKey = Me.ACCOUNTNAME)
sLastHeaderKey = Me.ACCOUNTNAME
End Sub


have an unbound field in the grouping you made and put this in for the control source: (change accountname to your field you are using)

=IIf(IsContinuedSection(),[accountname] & " (Continued)",[accountname])

you will need to put the field you are using in the grouping and make it not visible.

put this code in the visual basic also:

Private Function IsContinuedSection() As Boolean
IsContinuedSection = bContinuedSection And Page > 1
End Function
 
Last edited:
where does the last piece of visual basic go??
Private Function IsContinuedSection() As Boolean
IsContinuedSection = bContinuedSection And Page > 1
End Function


thanks (a fairly uninformed access builder...)
 
i'm getting the #Name? error... i checked all the places where the code above lists ACCOUNTNAME and i have substituted my field name, which is CATEGORY. any thoughts??
 
What is the ControlSource of the control showing the error?
 
What do you have in the group header / footer at the moment?
 

Users who are viewing this thread

Back
Top Bottom