By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,282 Members | 1,518 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,282 IT Pros & Developers. It's quick & easy.

printing odd pages of reports / duplex printing in Access 2002

P: n/a
I've been looking for a way to do a duplex print job without a duplex
printer. I reviewed some old posts about printing odd pages and found
that most of them led to KB article 101075 or an export of the
document to Word for duplexing there. I was looking for a VBA method
for doing this, so the KB article is right out and when you export to
Word, some of the report's text boxes wind up truncated because of
some sort of sizing difficulty with word and none of your borders or
images go along with it.

SOOOOO, that being said, I endeavored to create a module to handle it
for me. I created a new toolbar for all my reports and set the 'On
Action:' value for a button on the toolbar to a function in my
module....here's the code:

Public gintStart As Integer
Public gintEnd As Integer
Function PrintAll()

If gintEnd Mod 2 = 1 Then

gintStart = gintEnd + 2
Do
gintStart = gintStart - 2
DoCmd.PrintOut acPages, gintStart, gintStart, acDraft
Loop Until gintStart = 1

Response = MsgBox("Please remove the printed pages from the " _
& "printer, place them in the feeder tray face up, and " _
& "select 'OK' below when you are ready to finish printing", , _
"Continue Print Job")

gintStart = 0
Do
gintStart = gintStart + 2
DoCmd.PrintOut acPages, gintStart, gintStart, acDraft
Loop Until gintStart = gintEnd - 1

Else:
gintStart = gintEnd + 1
Do
gintStart = gintStart - 2
DoCmd.PrintOut acPages, gintStart, gintStart, acDraft
Loop Until gintStart = 1

Response = MsgBox("Please remove the printed pages from the " _
& "printer, place them in the feeder tray face up, and " _
& "select 'OK' below when you are ready to finish printing", , _
"Continue Print Job")

gintStart = 0
Do
gintStart = gintStart + 2
DoCmd.PrintOut acPages, gintStart, gintStart, acDraft
Loop Until gintStart = gintEnd
End If
End Function

Obviously, this requires the entering variable gintEnd which can be
populated with 'gintEnd = Me.Pages' in the 'OnPage' property of the
subject report. The code works fine, but needs one tweak to make it
solid:

The report gets to the output tray face down pages 1 thru X in order
and duplexed as desired. The hitch is, if the report has an odd number
of pages the last page is left in the feeder tray and doesn't roll
through. Anybody know a way to make that last page feed through the
printer and wind up with a blank page facing up at you in the output
tray as it should be?
Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Well, it's rather late at night for me, and I've not checked the code in any
detail, but my first thought is:

if (gintEnd MOD 2 = 0) then gintEnd = gintEnd +1

HTH

Rob
"Jamey Shuemaker" <ca*********@yahoo.com> wrote in message
news:42**************************@posting.google.c om...
I've been looking for a way to do a duplex print job without a duplex
printer. I reviewed some old posts about printing odd pages and found
that most of them led to KB article 101075 or an export of the
document to Word for duplexing there. I was looking for a VBA method
for doing this, so the KB article is right out and when you export to
Word, some of the report's text boxes wind up truncated because of
some sort of sizing difficulty with word and none of your borders or
images go along with it.

SOOOOO, that being said, I endeavored to create a module to handle it
for me. I created a new toolbar for all my reports and set the 'On
Action:' value for a button on the toolbar to a function in my
module....here's the code:

Public gintStart As Integer
Public gintEnd As Integer
Function PrintAll()

If gintEnd Mod 2 = 1 Then

gintStart = gintEnd + 2
Do
gintStart = gintStart - 2
DoCmd.PrintOut acPages, gintStart, gintStart, acDraft
Loop Until gintStart = 1

Response = MsgBox("Please remove the printed pages from the " _
& "printer, place them in the feeder tray face up, and " _
& "select 'OK' below when you are ready to finish printing", , _
"Continue Print Job")

gintStart = 0
Do
gintStart = gintStart + 2
DoCmd.PrintOut acPages, gintStart, gintStart, acDraft
Loop Until gintStart = gintEnd - 1

Else:
gintStart = gintEnd + 1
Do
gintStart = gintStart - 2
DoCmd.PrintOut acPages, gintStart, gintStart, acDraft
Loop Until gintStart = 1

Response = MsgBox("Please remove the printed pages from the " _
& "printer, place them in the feeder tray face up, and " _
& "select 'OK' below when you are ready to finish printing", , _
"Continue Print Job")

gintStart = 0
Do
gintStart = gintStart + 2
DoCmd.PrintOut acPages, gintStart, gintStart, acDraft
Loop Until gintStart = gintEnd
End If
End Function

Obviously, this requires the entering variable gintEnd which can be
populated with 'gintEnd = Me.Pages' in the 'OnPage' property of the
subject report. The code works fine, but needs one tweak to make it
solid:

The report gets to the output tray face down pages 1 thru X in order
and duplexed as desired. The hitch is, if the report has an odd number
of pages the last page is left in the feeder tray and doesn't roll
through. Anybody know a way to make that last page feed through the
printer and wind up with a blank page facing up at you in the output
tray as it should be?

Nov 13 '05 #2

P: n/a
thanks for the help, BUT...it wasn't a mod problem. the scripts work
fine and achieve the desired result of duplexing odd and even pages,
i'm just looking for a way to feed a blank page to get the last odd
page out of the feeder tray and into the output tray.
Nov 13 '05 #3

P: n/a
ca*********@yahoo.com (Jamey Shuemaker) wrote in
news:42**************************@posting.google.c om:
thanks for the help, BUT...it wasn't a mod problem. the
scripts work fine and achieve the desired result of duplexing
odd and even pages, i'm just looking for a way to feed a blank
page to get the last odd page out of the feeder tray and into
the output tray.


The mod is used to determine if you need to send an extra page
eject, in order to get the last page out.

Bob Quintal.

Nov 13 '05 #4

P: n/a
i tried that already. if you have a 7 page report sending the command:

DoCmd.PrintOut acPages, 7, 8, acDraft

will still only run one page through because access only recognizes
the need to print to the end of the document....i think. i'm just
looking for a page feed command.

Bob Quintal <bq******@generation.net> wrote in message news:<Xn**********************@66.150.105.50>...
ca*********@yahoo.com (Jamey Shuemaker) wrote in
news:42**************************@posting.google.c om:
thanks for the help, BUT...it wasn't a mod problem. the
scripts work fine and achieve the desired result of duplexing
odd and even pages, i'm just looking for a way to feed a blank
page to get the last odd page out of the feeder tray and into
the output tray.


The mod is used to determine if you need to send an extra page
eject, in order to get the last page out.

Bob Quintal.

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.