Duplex Printing With Binding Margin (Gutter)

C

Clifford Bass

Hello All,

My turn to ask a question. I have some reports that print in
landscape, using both sides of the page, that I put into three-ring binders.
Some of them are over 160 pages so I want to put as much as I can on each
page and want to keep the paper usage to a minimum. I use the flip-up duplex
option. Does anyone know how to get Access to do binding margins or page
gutters or whatever it is that they are called? What I want is for the
entire page from the header at the top to the footer at the bottom to be
shifted down by 1/2 inch when it is odd and shifted up 1/2 inch when it is
even.

Thanks,

Clifford Bass
 
F

fredg

Hello All,

My turn to ask a question. I have some reports that print in
landscape, using both sides of the page, that I put into three-ring binders.
Some of them are over 160 pages so I want to put as much as I can on each
page and want to keep the paper usage to a minimum. I use the flip-up duplex
option. Does anyone know how to get Access to do binding margins or page
gutters or whatever it is that they are called? What I want is for the
entire page from the header at the top to the footer at the bottom to be
shifted down by 1/2 inch when it is odd and shifted up 1/2 inch when it is
even.

Thanks,

Clifford Bass

I haven't re-checked this recently, but it should be OK.
Move the left position of each control as needed for each even page,
then back for each odd page.

In the Code Window Declarations section, write:

Option Compare Database
Option Explicit
Dim MoveMargin As Integer
====
Code the Report Header Format event:

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As
Integer)
MoveMargin = MoveMargin * -1
ChangeMargins
End Sub
=======

Code the Page Header Format event:

Private Sub PageHeader_Format(Cancel As Integer, FormatCount As
Integer)
If Me.Page = 1 Then
MoveMargin = 0
ElseIf Me.[Page] Mod 2 = 0 Then
MoveMargin = 1440
Else
MoveMargin = -1440
End If
ChangeMargins
End Sub
=========
Add a new Sub Procedure to the code window:

Public Sub ChangeMargins()
Dim C As Control
For Each C In Me.Controls
C.Left = C.Left + MoveMargin
Next C
End Sub
====

Change the value of MoveMargin as needed.
As written, it moves each control 1 inch, back and forth.
1440 = 1 inch, so you would use 1440 * 0.5 for 1/2 inch.
Make sure there is enough room to the right of the right-most controls
to allow for the movement towards the right.
 
C

Clifford Bass

Hi Fred,

Thanks for your answer. But what I am wanting is to move the contents
up and down. It probably can be adapted. Maybe there is an easier way, such
as changing the margins based on page number?

Clifford Bass

fredg said:
Hello All,

My turn to ask a question. I have some reports that print in
landscape, using both sides of the page, that I put into three-ring binders.
Some of them are over 160 pages so I want to put as much as I can on each
page and want to keep the paper usage to a minimum. I use the flip-up duplex
option. Does anyone know how to get Access to do binding margins or page
gutters or whatever it is that they are called? What I want is for the
entire page from the header at the top to the footer at the bottom to be
shifted down by 1/2 inch when it is odd and shifted up 1/2 inch when it is
even.

Thanks,

Clifford Bass

I haven't re-checked this recently, but it should be OK.
Move the left position of each control as needed for each even page,
then back for each odd page.

In the Code Window Declarations section, write:

Option Compare Database
Option Explicit
Dim MoveMargin As Integer
====
Code the Report Header Format event:

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As
Integer)
MoveMargin = MoveMargin * -1
ChangeMargins
End Sub
=======

Code the Page Header Format event:

Private Sub PageHeader_Format(Cancel As Integer, FormatCount As
Integer)
If Me.Page = 1 Then
MoveMargin = 0
ElseIf Me.[Page] Mod 2 = 0 Then
MoveMargin = 1440
Else
MoveMargin = -1440
End If
ChangeMargins
End Sub
=========
Add a new Sub Procedure to the code window:

Public Sub ChangeMargins()
Dim C As Control
For Each C In Me.Controls
C.Left = C.Left + MoveMargin
Next C
End Sub
====

Change the value of MoveMargin as needed.
As written, it moves each control 1 inch, back and forth.
1440 = 1 inch, so you would use 1440 * 0.5 for 1/2 inch.
Make sure there is enough room to the right of the right-most controls
to allow for the movement towards the right.
 
F

fredg

Hi Fred,

Thanks for your answer. But what I am wanting is to move the contents
up and down. It probably can be adapted. Maybe there is an easier way, such
as changing the margins based on page number?

Clifford Bass

fredg said:
Hello All,

My turn to ask a question. I have some reports that print in
landscape, using both sides of the page, that I put into three-ring binders.
Some of them are over 160 pages so I want to put as much as I can on each
page and want to keep the paper usage to a minimum. I use the flip-up duplex
option. Does anyone know how to get Access to do binding margins or page
gutters or whatever it is that they are called? What I want is for the
entire page from the header at the top to the footer at the bottom to be
shifted down by 1/2 inch when it is odd and shifted up 1/2 inch when it is
even.

Thanks,

Clifford Bass

I haven't re-checked this recently, but it should be OK.
Move the left position of each control as needed for each even page,
then back for each odd page.

In the Code Window Declarations section, write:

Option Compare Database
Option Explicit
Dim MoveMargin As Integer
====
Code the Report Header Format event:

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As
Integer)
MoveMargin = MoveMargin * -1
ChangeMargins
End Sub
=======

Code the Page Header Format event:

Private Sub PageHeader_Format(Cancel As Integer, FormatCount As
Integer)
If Me.Page = 1 Then
MoveMargin = 0
ElseIf Me.[Page] Mod 2 = 0 Then
MoveMargin = 1440
Else
MoveMargin = -1440
End If
ChangeMargins
End Sub
=========
Add a new Sub Procedure to the code window:

Public Sub ChangeMargins()
Dim C As Control
For Each C In Me.Controls
C.Left = C.Left + MoveMargin
Next C
End Sub
====

Change the value of MoveMargin as needed.
As written, it moves each control 1 inch, back and forth.
1440 = 1 inch, so you would use 1440 * 0.5 for 1/2 inch.
Make sure there is enough room to the right of the right-most controls
to allow for the movement towards the right.

Aha! I missed that 'flip up duplex' part.
I don't know how you are 'hanging' the sheets. From the top or from
the bottom.
Try it this way:
In Landscape orientation.....
Code the Page Header Format event:

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
Dim C As Control
If Me.Page Mod 2 = 1 Then
For Each C In Me.Controls
C.Top = C.Top - 1400 * 0.5
Next C
Else
For Each C In Me.Controls
C.Top = C.Top + 1400 * 0.5
Next C
End If

End Sub

Make sure you leave at least 1/2 inch room at the top of each section
for the controls to move up if you are moving by 1/2 inch.
Odd page holes are at the bottom.
Even page holes are at the top.

You can reverse the logic if you wish the hole locations reversed.
Just make sure you then leave that extra 1/2 inch at the bottom of the
section instead of the top.

Let me know if this works out OK.
 
C

Clifford Bass

Hi Fred,

That got me working in the right direction. Your thoughts are
appreciated. Here is what I ended up with (other stuff removed):

======================================

Option Base 0

' This one really in another module
Public Const g_cintQuarterInchInTwips As Integer = 360 ' (1440 / 4)

Private m_ctrlarrControlTops() As Integer
Private m_intControlUpperBound As Integer
Private m_intarrPageFooterHeights(1) As Integer
Private m_intarrPageHeaderHeights(1) As Integer

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

[PageFooterSection].Height = m_intarrPageFooterHeights(Page Mod 2)

End Sub

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

Dim intIndex1 As Integer
Dim intIndex2 As Integer

If Page = 1 Then
intIndex2 = 0
Else
intIndex2 = Page Mod 2
End If
For intIndex1 = 0 To m_intControlUpperBound Step 1
With [PageHeaderSection].Controls.Item(intIndex1)
.Top = m_ctrlarrControlTops(intIndex1, intIndex2)
End With
Next intIndex1
[PageHeaderSection].Height = m_intarrPageHeaderHeights(intIndex2)

End Sub

Private Sub Report_Open(Cancel As Integer)

Dim intIndex As Integer

m_intControlUpperBound = [PageHeaderSection].Controls.Count - 1
ReDim m_ctrlarrControlTops(m_intControlUpperBound, 1)
For intIndex = 0 To m_intControlUpperBound Step 1
With [PageHeaderSection].Controls.Item(intIndex)
m_ctrlarrControlTops(intIndex, 0) = .Top
m_ctrlarrControlTops(intIndex, 1) = .Top +
g_cintQuarterInchInTwips
End With
Next intIndex
m_intarrPageFooterHeights(0) = [PageFooterSection].Height +
g_cintQuarterInchInTwips
m_intarrPageFooterHeights(1) = [PageFooterSection].Height
m_intarrPageHeaderHeights(0) = [PageHeaderSection].Height
m_intarrPageHeaderHeights(1) = [PageHeaderSection].Height +
g_cintQuarterInchInTwips

End Sub

=================================================

It turns out that I needed to resize the header for each page as I
adjusted stuff up and down, otherwise the blanks space below the lowest item
would not shrink and expand correctly. Adjusting the footer ended up just a
case of adjusting the height. Since I was using a report header also, I had
to make the first page a special case. Storing the odd and even page heights
of the page header and footer sections, along with the odd and even top
values of the controls in the header enabled me to avoid recalculating them
each time. Storing them in arrays that have 0 for a lower bound and 1 for an
upper enabled me to use the Page Mod 2 as the index; no if this else that.
Oh yes, I only had to adjust the top values of the controls in the header,
not the entire report. Oh and one other thing I discovered, 1400 should
really be 1440.

Thanks Again,

Clifford Bass
 

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