RHubbard
09-06-2006, 05:44 AM
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
See if this is any help
http://www.access-programmers.co.uk/forums/showthread.php?t=90968
67flyer
09-06-2006, 11:53 AM
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
aben77
08-28-2008, 12:36 PM
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...)
Pat Hartman
08-28-2008, 04:28 PM
It goes in the report's class module.
aben77
08-29-2008, 07:57 AM
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??
Pat Hartman
08-29-2008, 09:47 PM
What is the ControlSource of the control showing the error?
What do you have in the group header / footer at the moment?