Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / February 2006

Tip: Looking for answers? Try searching our database.

HOWTO: Reset Page Header for Each Group

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dan Johnson - 07 Feb 2006 17:26 GMT
Earlier this week I had a problem getting a page header to NOT print on the
first page of a group.  Marshall's response was to add the following code:

Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
   Me.Section(3).Visible = False
End Sub

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
   Page = 1
   Me.Section(3).Visible = True
End Sub

This works fine as far as viewing the report on the screen, but I was still
getting the page header section on Print, so I added the following:

Private Sub GroupFooter1_Print(Cancel As Integer, PrintCount As Integer)
   Me.Section(3).Visible = False
End Sub

Private Sub GroupHeader0_Print(Cancel As Integer, PrintCount As Integer)
   Page = 1
   Me.Section(3).Visible = True
End Sub

I had also set the group header section's ForceNewPage property is set to
BeforeSection earlier.

Can anyone see why this works for viewing onscreen, but not for printing?

Thanks!

Dan
fredg - 07 Feb 2006 19:06 GMT
> Earlier this week I had a problem getting a page header to NOT print on the
> first page of a group.  Marshall's response was to add the following code:
[quoted text clipped - 28 lines]
>
> Dan

Probably because you set the sections to false when previewed, but
then never reset the section before printing.

Code the Report Header Format event:
Me.Section(x).Visible = True
Me.Section(y).Visible = True
etc.,
where x and y are the section numbers.

Then let your other code run as needed to make the section visible =
False.

Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Dan Johnson - 07 Feb 2006 20:44 GMT
That seems to have worked, Fred.  Thanks!

> > Earlier this week I had a problem getting a page header to NOT print on the
> > first page of a group.  Marshall's response was to add the following code:
[quoted text clipped - 40 lines]
> Then let your other code run as needed to make the section visible =
> False.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.