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 / October 2004

Tip: Looking for answers? Try searching our database.

Force new page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phil - 09 Oct 2004 15:25 GMT
HI,

I have a form with a command button that previews a report
with a group on teachers and a group heading
called "GroupHeader2".

I want to place a check box on the form called "ckNewPage"
which if checked will cause the report to force a new page
for each teacher.  What code would I use and where would
it go?  I've tried  many things but no success....

Thanks,
Phil
Allen Browne - 09 Oct 2004 16:08 GMT
Use the Open event of the report to read the check box (if the form is
open), and set the ForceNewPage property of the group header:

Private Sub Report_Open(Cancel As Integer)
   Const conNewPageBefore As Byte = 1

   If CurrentProject.AllForms("NameOfYourFormHere").IsLoaded Then
       If (Forms("NameOfYourFormHere")!chNewPage.Value) Then
           Me.Section(acGroupLevel1Header).ForceNewPage = conNewPageBefore
       End If
   End If
End Sub

Note: Access 97 and earlier do not have the AllForms collection. For those
versions, copy the IsLoaded() function from the Northwind sample database,
and use that instead.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> I have a form with a command button that previews a report
> with a group on teachers and a group heading
[quoted text clipped - 7 lines]
> Thanks,
> Phil
 
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.