Access 97 - Reports, making Group Headers repeat at top of new pag

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I was wondering if anyone knows the answer to this:
When using Sorting and Grouping, and putting in a Group Header, is there a
way of getting Access to repeat the Group Header at the top of a new page.

It doesn't work to use the page header as the Detail can change half way
through a page, therefore, you need a group header. I've tried putting the
same headings in the Page and Group header, but then sometimes they appear
twice due to how the data falls.
 
Take a look at the properties of the Group Header section. There's a
RepeatSection property on the Format tab (or on the All tab, of course!)
 
Take a look at the properties of the Group Header section. There's a
RepeatSection property on the Format tab (or on the All tab, of course!)
 
I did try this, and it works up to a point, but the problem with it is if one
of your "values" comes to an end at the bottom of a page, then the group
header for that value gets put onto the next page, with nothing below it.
Then it goes onto the next value.

For example, my Tracker rate products finish on page one, but at the top of
page 2, it shows Tracker in the group header - with nothing below it, then
goes onto my Variable rate products. Any more thoughts
 
I did try this, and it works up to a point, but the problem with it is if one
of your "values" comes to an end at the bottom of a page, then the group
header for that value gets put onto the next page, with nothing below it.
Then it goes onto the next value.

For example, my Tracker rate products finish on page one, but at the top of
page 2, it shows Tracker in the group header - with nothing below it, then
goes onto my Variable rate products. Any more thoughts
 
In the grouping & sorting dialog box (where you determine the sort order for
your data, whether there are group headers, footers, etc.) you can select
"keep together" which should prevent a header to appear on a page without
data. Failing that, a similar option is available under the properties of
the header itself.
 
In the grouping & sorting dialog box (where you determine the sort order for
your data, whether there are group headers, footers, etc.) you can select
"keep together" which should prevent a header to appear on a page without
data. Failing that, a similar option is available under the properties of
the header itself.
 
Tried that! For some reason it seems to be that when you switch on the
"RepeatSection" property, it repeats at the top of the next page when the
value ends exactly at the bottom of the page before.
 
Tried that! For some reason it seems to be that when you switch on the
"RepeatSection" property, it repeats at the top of the next page when the
value ends exactly at the bottom of the page before.
 
Try putting this in the Group Section's Format Event (no guarantees though)

Private Sub GroupHeader1_Format(...)
Static LastVal As String

If FormatCount >1 Then Exit Sub
If Len(LastVal)=0 Then
LastVal = Me.[HeaderField] ' subsitute
exit Sub
Else
Cancel = LastVal<>Me.[HeaderField]
LastVal = Me.[HeaderField] ' subsitute
End If
End Sub

HTH

Pieter
 
Try putting this in the Group Section's Format Event (no guarantees though)

Private Sub GroupHeader1_Format(...)
Static LastVal As String

If FormatCount >1 Then Exit Sub
If Len(LastVal)=0 Then
LastVal = Me.[HeaderField] ' subsitute
exit Sub
Else
Cancel = LastVal<>Me.[HeaderField]
LastVal = Me.[HeaderField] ' subsitute
End If
End Sub

HTH

Pieter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top