mirrored margin for print out forms

G

Guest

Hi everyone. thank you for having a great community here.

I am wondering if anyone knows how to print out a FORM in mirrored margin
for punching holes and put into a binder. I.e, on odd number page, I want
left-side margin wide, but on even number page, right-side margin wide.

Word has this option in page-layout but not in Acess.
Thank you!!
 
F

fredg

Hi everyone. thank you for having a great community here.

I am wondering if anyone knows how to print out a FORM in mirrored margin
for punching holes and put into a binder. I.e, on odd number page, I want
left-side margin wide, but on even number page, right-side margin wide.

Word has this option in page-layout but not in Acess.
Thank you!!

Don't print a form, print a report.

In a report, you can 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.
1440 = 1 inch.
Make sure there is enough room to the right of the right-most
controls to allow for the movement towards the right.

*** You may wish to make the following change.
In Design View, set ALL the controls left position
to what you wish for the EVEN pages.
Then change the above coding, from:
ElseIf Me.[Page] Mod 2 = 0 Then MoveMargin = 1440
To:
ElseIf NOT Me.[Page] Mod 2 = 0 Then MoveMargin = 1440

Remember... 1440 = 1 inch of movement.
Try it both ways and see if which layout suits your needs better.****
 
G

Guest

OMG!! Fredg, Thank you soooooo much for explaning and even giving me sample
like this. Must've took some time typing it this up.

I am very appreciative and will try... ;) might take some time since I
already have very complicated layout in a form set up. ;)

fredg said:
Hi everyone. thank you for having a great community here.

I am wondering if anyone knows how to print out a FORM in mirrored margin
for punching holes and put into a binder. I.e, on odd number page, I want
left-side margin wide, but on even number page, right-side margin wide.

Word has this option in page-layout but not in Acess.
Thank you!!

Don't print a form, print a report.

In a report, you can 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.
1440 = 1 inch.
Make sure there is enough room to the right of the right-most
controls to allow for the movement towards the right.

*** You may wish to make the following change.
In Design View, set ALL the controls left position
to what you wish for the EVEN pages.
Then change the above coding, from:
ElseIf Me.[Page] Mod 2 = 0 Then MoveMargin = 1440
To:
ElseIf NOT Me.[Page] Mod 2 = 0 Then MoveMargin = 1440

Remember... 1440 = 1 inch of movement.
Try it both ways and see if which layout suits your needs better.****
 

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