Odd/even page different detail section

C

CJay

I would like to creat a report with different detail sections for facing
pages of a report.

Any help would be most appreciated.

I have thought of having a set of fields that print if the pageno is odd and
a set of fields that print if the page no is even using a mod function that
access doesn't seem to have unlike excel / foxpro. So help as to how to write
a mod function would also be useful unless I've missed something in the math
functions already.

These fields could be tested separately one row below the other and when it
works overlay the odd set over the even set in the detail section. OK editing
after testing would be difficult, but I would have to keep the original
separately as well.

Thanks

CJ
 
F

fredg

I would like to creat a report with different detail sections for facing
pages of a report.

Any help would be most appreciated.

I have thought of having a set of fields that print if the pageno is odd and
a set of fields that print if the page no is even using a mod function that
access doesn't seem to have unlike excel / foxpro. So help as to how to write
a mod function would also be useful unless I've missed something in the math
functions already.

These fields could be tested separately one row below the other and when it
works overlay the odd set over the even set in the detail section. OK editing
after testing would be difficult, but I would have to keep the original
separately as well.

Thanks

CJ

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.****
 
C

CJay

Thanks for the quick reply fred.

It will take me a couple of days to get enough time to try all this but it
looks great.

Just one quick note what's the official conversion of 1440 to metric or
isn't there one as 1440 /2.539 gives 567.15......

Thanks

CJ

fredg said:
I would like to creat a report with different detail sections for facing
pages of a report.

Any help would be most appreciated.

I have thought of having a set of fields that print if the pageno is odd and
a set of fields that print if the page no is even using a mod function that
access doesn't seem to have unlike excel / foxpro. So help as to how to write
a mod function would also be useful unless I've missed something in the math
functions already.

These fields could be tested separately one row below the other and when it
works overlay the odd set over the even set in the detail section. OK editing
after testing would be difficult, but I would have to keep the original
separately as well.

Thanks

CJ

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.****
 
C

CJay

I'm having problems using this it seems just what i need but what exactly do
i put in the the left margin property for the item concerned.

Thanks

CJ

fredg said:
I would like to creat a report with different detail sections for facing
pages of a report.

Any help would be most appreciated.

I have thought of having a set of fields that print if the pageno is odd and
a set of fields that print if the page no is even using a mod function that
access doesn't seem to have unlike excel / foxpro. So help as to how to write
a mod function would also be useful unless I've missed something in the math
functions already.

These fields could be tested separately one row below the other and when it
works overlay the odd set over the even set in the detail section. OK editing
after testing would be difficult, but I would have to keep the original
separately as well.

Thanks

CJ

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.****
 
C

Chuck

I'm having problems using this it seems just what i need but what exactly do
i put in the the left margin property for the item concerned.

Thanks

CJ
Excel: MOD(x,y)
Access: x MOD y
These fields could be tested separately one row below the other and when it
works overlay the odd set over the even set in the detail section. OK editing
after testing would be difficult, but I would have to keep the original
separately as well.

Thanks

CJ

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