Force report to print an even number of pages per record

  • Thread starter Thread starter Geoff Taylor
  • Start date Start date
G

Geoff Taylor

I have currently designed a report that prints students academic reports.
Each student is defined by SKEY and each student has a number of subject
records defined by SUKEY.
The report prints a general summary page in the SKEY header and 8 to 14
subject pages in the detail.

Report Header
Page Header
SKEY Header
(subreport - summary page)

Detail (9 to 14 SUKEY pages)
SKEY Footer
Page Footer
Report Footer

The need I have, is to ensure that the report for each SKEY ends up as an
even number of pages.
This is so that the reports can be printed duplexed (both sides of the
paper) on a networked photocopier.
When the current version prints, and the report prints with an odd number of
pages per student, then the start of the next record will print on the back
of the last page of the the student's report.

So far, I have an expression in the SKEY footer that correctly determines
that the number of pages is odd or even. This because I am using a routine
that prints "page x of y" in the Page footer. I have a variable [page] that
is equal to the number of pages that print for each SKEY.
I can use
If ( [Page] Mod 2) = 1 then ....
--
Geoff Taylor
IT Manager
Carine Senior High School
Western Australia

How can I get this expression to print an extra blank page when the last
page is odd?
 
Here is a reply I used in a previous post. I believe it does what you are
asking.

..... then I tried something that appears to work. You appear
have a "group header" to group on the customer for each invoice and it
appears that this section is set to give a page break before the section.
Create a group footer as well. Place a page break control in the group
footer. In the OnFormat event of the group footer use code similar to
this:

Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
If Page Mod 2 <> 0 Then
Me.PageBreak1.Visible = True
Else
Me.PageBreak1.Visible = False
End If
End Sub

What this will do is force another page if the group doesn't end on an even
page number.
 
Thanks Wayne...

The syntax shown does not seem to work.
I get a "method or data member" not found for the following...

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
If [Page] Mod 2 <> 0 Then
Me.PageBreak0.Visible = True
Else
Me.PageBreak0.Visible = False
End If
End Sub



Wayne Morgan said:
Here is a reply I used in a previous post. I believe it does what you are
asking.

.... then I tried something that appears to work. You appear
have a "group header" to group on the customer for each invoice and it
appears that this section is set to give a page break before the section.
Create a group footer as well. Place a page break control in the group
footer. In the OnFormat event of the group footer use code similar to
this:

Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
If Page Mod 2 <> 0 Then
Me.PageBreak1.Visible = True
Else
Me.PageBreak1.Visible = False
End If
End Sub

What this will do is force another page if the group doesn't end on an even
page number.

--
Wayne Morgan
MS Access MVP


Geoff Taylor said:
I have currently designed a report that prints students academic reports.
Each student is defined by SKEY and each student has a number of subject
records defined by SUKEY.
The report prints a general summary page in the SKEY header and 8 to 14
subject pages in the detail.

Report Header
Page Header
SKEY Header
(subreport - summary page)

Detail (9 to 14 SUKEY pages)
SKEY Footer
Page Footer
Report Footer

The need I have, is to ensure that the report for each SKEY ends up as an
even number of pages.
This is so that the reports can be printed duplexed (both sides of the
paper) on a networked photocopier.
When the current version prints, and the report prints with an odd
number
of
pages per student, then the start of the next record will print on the back
of the last page of the the student's report.

So far, I have an expression in the SKEY footer that correctly determines
that the number of pages is odd or even. This because I am using a routine
that prints "page x of y" in the Page footer. I have a variable [page] that
is equal to the number of pages that print for each SKEY.
I can use
If ( [Page] Mod 2) = 1 then ....
--
Geoff Taylor
IT Manager
Carine Senior High School
Western Australia

How can I get this expression to print an extra blank page when the last
page is odd?
 
When you get the error what line is highlighted? Did you adjust the names to
match those of your group footer section and your page break control?

--
Wayne Morgan
MS Access MVP


Geoff Taylor said:
Thanks Wayne...

The syntax shown does not seem to work.
I get a "method or data member" not found for the following...

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
If [Page] Mod 2 <> 0 Then
Me.PageBreak0.Visible = True
Else
Me.PageBreak0.Visible = False
End If
End Sub



Here is a reply I used in a previous post. I believe it does what you are
asking.

.... then I tried something that appears to work. You appear
have a "group header" to group on the customer for each invoice and it
appears that this section is set to give a page break before the section.
Create a group footer as well. Place a page break control in the group
footer. In the OnFormat event of the group footer use code similar to
this:

Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
If Page Mod 2 <> 0 Then
Me.PageBreak1.Visible = True
Else
Me.PageBreak1.Visible = False
End If
End Sub

What this will do is force another page if the group doesn't end on an even
page number.

--
Wayne Morgan
MS Access MVP


Geoff Taylor said:
I have currently designed a report that prints students academic reports.
Each student is defined by SKEY and each student has a number of subject
records defined by SUKEY.
The report prints a general summary page in the SKEY header and 8 to 14
subject pages in the detail.

Report Header
Page Header
SKEY Header
(subreport - summary page)

Detail (9 to 14 SUKEY pages)
SKEY Footer
Page Footer
Report Footer

The need I have, is to ensure that the report for each SKEY ends up as an
even number of pages.
This is so that the reports can be printed duplexed (both sides of the
paper) on a networked photocopier.
When the current version prints, and the report prints with an odd
number
of
pages per student, then the start of the next record will print on the back
of the last page of the the student's report.

So far, I have an expression in the SKEY footer that correctly determines
that the number of pages is odd or even. This because I am using a routine
that prints "page x of y" in the Page footer. I have a variable [page] that
is equal to the number of pages that print for each SKEY.
I can use
If ( [Page] Mod 2) = 1 then ....
--
Geoff Taylor
IT Manager
Carine Senior High School
Western Australia

How can I get this expression to print an extra blank page when the last
page is odd?
 
Wayne...

The following is highlighted when the error occurs...

..PageBreak0

I tried it without Me. and it stopped with a runtime error 424 debug message
on ..

PageBreak0.Visible = False

(indicating that the "even" page condition was being met)

The event procedure for the SKEY footer automatically sets the name
according to the section.
Which "page break control"?



Wayne Morgan said:
When you get the error what line is highlighted? Did you adjust the names to
match those of your group footer section and your page break control?

--
Wayne Morgan
MS Access MVP


Geoff Taylor said:
Thanks Wayne...

The syntax shown does not seem to work.
I get a "method or data member" not found for the following...

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
If [Page] Mod 2 <> 0 Then
Me.PageBreak0.Visible = True
Else
Me.PageBreak0.Visible = False
End If
End Sub



Here is a reply I used in a previous post. I believe it does what you are
asking.

.... then I tried something that appears to work. You appear
have a "group header" to group on the customer for each invoice and it
appears that this section is set to give a page break before the section.
Create a group footer as well. Place a page break control in the group
footer. In the OnFormat event of the group footer use code similar to
this:

Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
If Page Mod 2 <> 0 Then
Me.PageBreak1.Visible = True
Else
Me.PageBreak1.Visible = False
End If
End Sub

What this will do is force another page if the group doesn't end on an even
page number.

--
Wayne Morgan
MS Access MVP


I have currently designed a report that prints students academic reports.
Each student is defined by SKEY and each student has a number of subject
records defined by SUKEY.
The report prints a general summary page in the SKEY header and 8 to 14
subject pages in the detail.

Report Header
Page Header
SKEY Header
(subreport - summary page)

Detail (9 to 14 SUKEY pages)
SKEY Footer
Page Footer
Report Footer

The need I have, is to ensure that the report for each SKEY ends up
as
an
even number of pages.
This is so that the reports can be printed duplexed (both sides of the
paper) on a networked photocopier.
When the current version prints, and the report prints with an odd number
of
pages per student, then the start of the next record will print on the
back
of the last page of the the student's report.

So far, I have an expression in the SKEY footer that correctly determines
that the number of pages is odd or even. This because I am using a routine
that prints "page x of y" in the Page footer. I have a variable [page]
that
is equal to the number of pages that print for each SKEY.
I can use
If ( [Page] Mod 2) = 1 then ....
--
Geoff Taylor
IT Manager
Carine Senior High School
Western Australia

How can I get this expression to print an extra blank page when the last
page is odd?
 
The PageBreak0, that's a zero, is the name of the page break control I
placed in the group footer. The page break control is one of the controls on
the tool box along with the textboxes, etc. I just did it as a test, so I
didn't change it from the default name that Access gave it. Have you put a
Page Break control in the group footer and if so, what's its name?

--
Wayne Morgan
MS Access MVP


Geoff Taylor said:
Wayne...

The following is highlighted when the error occurs...

.PageBreak0

I tried it without Me. and it stopped with a runtime error 424 debug message
on ..

PageBreak0.Visible = False

(indicating that the "even" page condition was being met)

The event procedure for the SKEY footer automatically sets the name
according to the section.
Which "page break control"?



When you get the error what line is highlighted? Did you adjust the
names
to
match those of your group footer section and your page break control?

--
Wayne Morgan
MS Access MVP


Geoff Taylor said:
Thanks Wayne...

The syntax shown does not seem to work.
I get a "method or data member" not found for the following...

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
If [Page] Mod 2 <> 0 Then
Me.PageBreak0.Visible = True
Else
Me.PageBreak0.Visible = False
End If
End Sub



Here is a reply I used in a previous post. I believe it does what
you
are
asking.

.... then I tried something that appears to work. You appear
have a "group header" to group on the customer for each invoice and it
appears that this section is set to give a page break before the section.
Create a group footer as well. Place a page break control in the group
footer. In the OnFormat event of the group footer use code similar to
this:

Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
If Page Mod 2 <> 0 Then
Me.PageBreak1.Visible = True
Else
Me.PageBreak1.Visible = False
End If
End Sub

What this will do is force another page if the group doesn't end on an
even
page number.

--
Wayne Morgan
MS Access MVP


I have currently designed a report that prints students academic
reports.
Each student is defined by SKEY and each student has a number of subject
records defined by SUKEY.
The report prints a general summary page in the SKEY header and 8
to
14
subject pages in the detail.

Report Header
Page Header
SKEY Header
(subreport - summary page)

Detail (9 to 14 SUKEY pages)
SKEY Footer
Page Footer
Report Footer

The need I have, is to ensure that the report for each SKEY ends
up
as
an
even number of pages.
This is so that the reports can be printed duplexed (both sides of the
paper) on a networked photocopier.
When the current version prints, and the report prints with an odd
number
of
pages per student, then the start of the next record will print on the
back
of the last page of the the student's report.

So far, I have an expression in the SKEY footer that correctly
determines
that the number of pages is odd or even. This because I am using a
routine
that prints "page x of y" in the Page footer. I have a variable [page]
that
is equal to the number of pages that print for each SKEY.
I can use
If ( [Page] Mod 2) = 1 then ....
--
Geoff Taylor
IT Manager
Carine Senior High School
Western Australia

How can I get this expression to print an extra blank page when
the
last
page is odd?
 
Wayne..

Thanks for the assistance.
I found the page break control.
I could not find a visible property for a page break though.
Setting the syntax as you suggested did not work, however it did point me in
the right direction.

I simply pulled the section footer for SKEY out into a page (and inserted
the typical "this page has intentionally left blank" message on it)
The I set the visibility of the footer itself using the [page] condition,
though it required the opposite sense.
The following is working perfectly for me now...

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)

If [Page] Mod 2 = 0 Then
GroupFooter0.Visible = True
Else
GroupFooter0.Visible = False
End If

End Sub

Thanks again!!


Wayne Morgan said:
The PageBreak0, that's a zero, is the name of the page break control I
placed in the group footer. The page break control is one of the controls on
the tool box along with the textboxes, etc. I just did it as a test, so I
didn't change it from the default name that Access gave it. Have you put a
Page Break control in the group footer and if so, what's its name?

--
Wayne Morgan
MS Access MVP


Geoff Taylor said:
Wayne...

The following is highlighted when the error occurs...

.PageBreak0

I tried it without Me. and it stopped with a runtime error 424 debug message
on ..

PageBreak0.Visible = False

(indicating that the "even" page condition was being met)

The event procedure for the SKEY footer automatically sets the name
according to the section.
Which "page break control"?



When you get the error what line is highlighted? Did you adjust the
names
to
match those of your group footer section and your page break control?

--
Wayne Morgan
MS Access MVP


Thanks Wayne...

The syntax shown does not seem to work.
I get a "method or data member" not found for the following...

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
If [Page] Mod 2 <> 0 Then
Me.PageBreak0.Visible = True
Else
Me.PageBreak0.Visible = False
End If
End Sub



message
Here is a reply I used in a previous post. I believe it does what you
are
asking.

.... then I tried something that appears to work. You appear
have a "group header" to group on the customer for each invoice
and
on
8
to
14
subject pages in the detail.

Report Header
Page Header
SKEY Header
(subreport - summary page)

Detail (9 to 14 SUKEY pages)
SKEY Footer
Page Footer
Report Footer

The need I have, is to ensure that the report for each SKEY ends
up
as
an
even number of pages.
This is so that the reports can be printed duplexed (both sides
of
the
paper) on a networked photocopier.
When the current version prints, and the report prints with an odd
number
of
pages per student, then the start of the next record will print
on
the
back
of the last page of the the student's report.

So far, I have an expression in the SKEY footer that correctly
determines
that the number of pages is odd or even. This because I am using a
routine
that prints "page x of y" in the Page footer. I have a variable [page]
that
is equal to the number of pages that print for each SKEY.
I can use
If ( [Page] Mod 2) = 1 then ....
--
Geoff Taylor
IT Manager
Carine Senior High School
Western Australia

How can I get this expression to print an extra blank page when the
last
page is odd?
 
Well, apparently you have something else wrong also; although, I don't know
what. There is diffinitly a visible property for a pagebreak control. Here
is an example from Microsoft:

http://support.microsoft.com/default.aspx?scid=kb;en-us;209006&Product=acc2000

--
Wayne Morgan
MS Access MVP


Geoff Taylor said:
Wayne..

Thanks for the assistance.
I found the page break control.
I could not find a visible property for a page break though.
Setting the syntax as you suggested did not work, however it did point me in
the right direction.

I simply pulled the section footer for SKEY out into a page (and inserted
the typical "this page has intentionally left blank" message on it)
The I set the visibility of the footer itself using the [page] condition,
though it required the opposite sense.
The following is working perfectly for me now...

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)

If [Page] Mod 2 = 0 Then
GroupFooter0.Visible = True
Else
GroupFooter0.Visible = False
End If

End Sub

Thanks again!!


The PageBreak0, that's a zero, is the name of the page break control I
placed in the group footer. The page break control is one of the
controls
on
the tool box along with the textboxes, etc. I just did it as a test, so I
didn't change it from the default name that Access gave it. Have you put a
Page Break control in the group footer and if so, what's its name?

--
Wayne Morgan
MS Access MVP


Geoff Taylor said:
Wayne...

The following is highlighted when the error occurs...

.PageBreak0

I tried it without Me. and it stopped with a runtime error 424 debug message
on ..

PageBreak0.Visible = False

(indicating that the "even" page condition was being met)

The event procedure for the SKEY footer automatically sets the name
according to the section.
Which "page break control"?



When you get the error what line is highlighted? Did you adjust the names
to
match those of your group footer section and your page break control?

--
Wayne Morgan
MS Access MVP


Thanks Wayne...

The syntax shown does not seem to work.
I get a "method or data member" not found for the following...

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As
Integer)
If [Page] Mod 2 <> 0 Then
Me.PageBreak0.Visible = True
Else
Me.PageBreak0.Visible = False
End If
End Sub



message
Here is a reply I used in a previous post. I believe it does
what
you
are
asking.

.... then I tried something that appears to work. You appear
have a "group header" to group on the customer for each invoice
and
it
appears that this section is set to give a page break before the
section.
Create a group footer as well. Place a page break control in the
group
footer. In the OnFormat event of the group footer use code
similar
to
this:

Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As
Integer)
If Page Mod 2 <> 0 Then
Me.PageBreak1.Visible = True
Else
Me.PageBreak1.Visible = False
End If
End Sub

What this will do is force another page if the group doesn't end
on
an
even
page number.

--
Wayne Morgan
MS Access MVP


I have currently designed a report that prints students academic
reports.
Each student is defined by SKEY and each student has a number of
subject
records defined by SUKEY.
The report prints a general summary page in the SKEY header
and
8 ends
up
sides
print
using
a
routine
that prints "page x of y" in the Page footer. I have a variable
[page]
that
is equal to the number of pages that print for each SKEY.
I can use
If ( [Page] Mod 2) = 1 then ....
--
Geoff Taylor
IT Manager
Carine Senior High School
Western Australia

How can I get this expression to print an extra blank page
when
the
last
page is odd?
 
Wayne...

As I said, I have a solution now that works.
In fact it provides a little more functionality by allowing text on blank
page rather than just being a blank produced by a pagebreak.

A did spend a little more time looking at the pagebreak method.
Ensuring the footer is opened up far enough to display the inserted
pagebreak object, then the pagebreak seems to respond to whether the page is
odd or even. However, it then correctly adds a blabk page when the last page
for an SKEY is odd, but incorrectly adds two blank pages when it is even.
IAt this stage I prefer to use the visible property of the fotter itself.

Thanks again

Wayne Morgan said:
Well, apparently you have something else wrong also; although, I don't know
what. There is diffinitly a visible property for a pagebreak control. Here
is an example from Microsoft:

http://support.microsoft.com/default.aspx?scid=kb;en-us;209006&Product=acc2000

--
Wayne Morgan
MS Access MVP


Geoff Taylor said:
Wayne..

Thanks for the assistance.
I found the page break control.
I could not find a visible property for a page break though.
Setting the syntax as you suggested did not work, however it did point
me
in
the right direction.

I simply pulled the section footer for SKEY out into a page (and inserted
the typical "this page has intentionally left blank" message on it)
The I set the visibility of the footer itself using the [page] condition,
though it required the opposite sense.
The following is working perfectly for me now...

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)

If [Page] Mod 2 = 0 Then
GroupFooter0.Visible = True
Else
GroupFooter0.Visible = False
End If

End Sub

Thanks again!!


The PageBreak0, that's a zero, is the name of the page break control I
placed in the group footer. The page break control is one of the
controls
on
the tool box along with the textboxes, etc. I just did it as a test,
so
put
a
Page Break control in the group footer and if so, what's its name?

--
Wayne Morgan
MS Access MVP


Wayne...

The following is highlighted when the error occurs...

.PageBreak0

I tried it without Me. and it stopped with a runtime error 424 debug
message
on ..

PageBreak0.Visible = False

(indicating that the "even" page condition was being met)

The event procedure for the SKEY footer automatically sets the name
according to the section.
Which "page break control"?



message
When you get the error what line is highlighted? Did you adjust the
names
to
match those of your group footer section and your page break control?

--
Wayne Morgan
MS Access MVP


Thanks Wayne...

The syntax shown does not seem to work.
I get a "method or data member" not found for the following...

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As
Integer)
If [Page] Mod 2 <> 0 Then
Me.PageBreak0.Visible = True
Else
Me.PageBreak0.Visible = False
End If
End Sub



message
Here is a reply I used in a previous post. I believe it does what
you
are
asking.

.... then I tried something that appears to work. You appear
have a "group header" to group on the customer for each
invoice
and
it
appears that this section is set to give a page break before the
section.
Create a group footer as well. Place a page break control in
the
number
of
subject
records defined by SUKEY.
The report prints a general summary page in the SKEY header
and
8
to
14
subject pages in the detail.

Report Header
Page Header
SKEY Header
(subreport - summary page)

Detail (9 to 14 SUKEY pages)
SKEY Footer
Page Footer
Report Footer

The need I have, is to ensure that the report for each SKEY ends
up
as
an
even number of pages.
This is so that the reports can be printed duplexed (both
sides
of
the
paper) on a networked photocopier.
When the current version prints, and the report prints with
an
odd
number
of
pages per student, then the start of the next record will
print
on
the
back
of the last page of the the student's report.

So far, I have an expression in the SKEY footer that correctly
determines
that the number of pages is odd or even. This because I am
using
a
routine
that prints "page x of y" in the Page footer. I have a variable
[page]
that
is equal to the number of pages that print for each SKEY.
I can use
If ( [Page] Mod 2) = 1 then ....
--
Geoff Taylor
IT Manager
Carine Senior High School
Western Australia

How can I get this expression to print an extra blank page when
the
last
page is odd?
 
No problem, if it works, don't fix it. I was only commenting that the
property of the page break should exist, you had stated that you couldn't
find it.
 
Back
Top