mirror margins for even and odd pages

G

Guest

I need to create double sided reports and may pages have different margins on
the left and right. I have read some of the solutions in this group and the
only one that had some codes involved ends up with errors that can not be
solved.

Does anyone know how to set mirror margins for even and odd pages of a report?

Thanks for your help in advance
 
F

fredg

I need to create double sided reports and may pages have different margins on
the left and right. I have read some of the solutions in this group and the
only one that had some codes involved ends up with errors that can not be
solved.

Does anyone know how to set mirror margins for even and odd pages of a report?

Thanks for your help in advance

Not wanting to ruffle your feathers, but what's the point of replying
and perhaps giving the same 'how to' solution you couldn't make work?
How do we know what you have tried?

As the Report Header only prints on Page 1, place the report header
controls where you want the odd page controls to print.

Place this code in the PAGE Header format event.
Make sure there is enough page width available to move the controls to
the right as needed

Dim c As Control
For Each c In Controls
If Me.[Page] Mod 2 = 1 Then
c.Left = c.Left + 1440
Else
c.Left = c.Left - 1440
End If
Next c

The above works for me.
Odd page controls are moved to the right 1 inch, even page controls
back to the left 1 inch. All measurements are in Twips, 1440 per inch.
Adjust your control movement accordingly.
 
G

Guest

Thanks for the help, the margin are now moving as the pages change but there
is only one problem. I can not print the report on any of our printers here
and not even with a .pdf maker.

when i try to print the report it seems to sit on the first page and can not
figure out what to do. the report prints fine if I take the coding for the
margin out. It also does not make any difference whether I print in duplex or
single pages.

Any idea?

fredg said:
I need to create double sided reports and may pages have different margins on
the left and right. I have read some of the solutions in this group and the
only one that had some codes involved ends up with errors that can not be
solved.

Does anyone know how to set mirror margins for even and odd pages of a report?

Thanks for your help in advance

Not wanting to ruffle your feathers, but what's the point of replying
and perhaps giving the same 'how to' solution you couldn't make work?
How do we know what you have tried?

As the Report Header only prints on Page 1, place the report header
controls where you want the odd page controls to print.

Place this code in the PAGE Header format event.
Make sure there is enough page width available to move the controls to
the right as needed

Dim c As Control
For Each c In Controls
If Me.[Page] Mod 2 = 1 Then
c.Left = c.Left + 1440
Else
c.Left = c.Left - 1440
End If
Next c

The above works for me.
Odd page controls are moved to the right 1 inch, even page controls
back to the left 1 inch. All measurements are in Twips, 1440 per inch.
Adjust your control movement accordingly.
 
F

fredg

Thanks for the help, the margin are now moving as the pages change but there
is only one problem. I can not print the report on any of our printers here
and not even with a .pdf maker.

when i try to print the report it seems to sit on the first page and can not
figure out what to do. the report prints fine if I take the coding for the
margin out. It also does not make any difference whether I print in duplex or
single pages.

Any idea?

fredg said:
I need to create double sided reports and may pages have different margins on
the left and right. I have read some of the solutions in this group and the
only one that had some codes involved ends up with errors that can not be
solved.

Does anyone know how to set mirror margins for even and odd pages of a report?

Thanks for your help in advance

Not wanting to ruffle your feathers, but what's the point of replying
and perhaps giving the same 'how to' solution you couldn't make work?
How do we know what you have tried?

As the Report Header only prints on Page 1, place the report header
controls where you want the odd page controls to print.

Place this code in the PAGE Header format event.
Make sure there is enough page width available to move the controls to
the right as needed

Dim c As Control
For Each c In Controls
If Me.[Page] Mod 2 = 1 Then
c.Left = c.Left + 1440
Else
c.Left = c.Left - 1440
End If
Next c

The above works for me.
Odd page controls are moved to the right 1 inch, even page controls
back to the left 1 inch. All measurements are in Twips, 1440 per inch.
Adjust your control movement accordingly.


Add error handling.

On Error GoTo Err_Handler

Dim c As Control
For Each c In Controls
If Me.[Page] Mod 2 = 1 Then
c.Left = c.Left + 1440
Else
c.Left = c.Left - 1440
End If
Next c
Exit_Sub:
Exit Sub
Err_Handler:
If Err = 2100 Then
Else
MsgBox Err.Number & " " & Err.Description
End If
Resume Exit_Sub
 

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