set Force New Page

M

Microsoft

is it possible to set the Force New Page on a Group Footer from code?

I want to be able to give the option of printing each Job on a new sheet or
not.

If yes, how do I do it ?

Thanks
A
 
F

fredg

is it possible to set the Force New Page on a Group Footer from code?

I want to be able to give the option of printing each Job on a new sheet or
not.

If yes, how do I do it ?

Thanks
A

And what is the option method you wish to use? An OptionGroup?
From where? A form?

I would set the Group Header to ForceNewPage BeforeSection rather
thatn the Group Footer to After Section.

Code the Report's Open event:

If CurrentProject.AllForms("FormName").IsLoaded Then
If Forms!FormName!OptionControl = 1 Then
Me.Section(5).ForceNewPage = 1
Else
Me.Section(5).ForceNewPage = 0
End If
End If

Change Section(5) to whatever the actual Group Header number is.
Change "Formname" to whatever the actual name of your form is that
gives the user the option.
Change OptionControl = 1 to whatever control name and value you are
using.
 
M

Microsoft

Thanks
My report hierarchy is:
Manager Header
Project Header
Detail
Project Footer - Force Page here

If I put the Force page in Project Header I get a blank page with Manager
Header before the Projects start printing.

I'm calling it from a form and wish to use a check box - this part I am ok
with.

Where does the section number come from?
I'm using Access 2007

Thanks for your help so far
A
 
M

Marshall Barton

Microsoft said:
is it possible to set the Force New Page on a Group Footer from code?

I want to be able to give the option of printing each Job on a new sheet or
not.

If yes, how do I do it ?


Check VBA Help on the property fo the value of the After
Section setting.

Note that for most of this kind of thing to be effective,
you need to set the property before the footer section is
formatted.

An alternative is to place a page break control at the
bottom of the section and use its Visible property to tune
it on or off. This can be a little tricky because you
probably do not want a page break when the footer is near
the top of a page.
 
F

fredg

Thanks
My report hierarchy is:
Manager Header
Project Header
Detail
Project Footer - Force Page here

If I put the Force page in Project Header I get a blank page with Manager
Header before the Projects start printing.

I'm calling it from a form and wish to use a check box - this part I am ok
with.

Where does the section number come from?
I'm using Access 2007

Thanks for your help so far
A

Hmmmm. And where does your original message state that you have more
than one Header/Footer?

Look up the ForceNewPage property in VBA help.
Look up the Section property + Section property as it applies to the
Form and Report objects. in VBA help.

I guess I could have written
Me.Section(acGroupLevel1Header)
instead of Me.Section(5) but I'm lazy. ;-)

If you wish to use the Project Footer AfteSection it's OK by me.
Set the section to the correct ProjectFooter section value and use = 2
instead of =1 to choose AfterSection.

Note: I use Access 2002. I'm assuming Access 2007 would be the same
for the ForceNewPage property.
 

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

Top