S
S
Hi,
I have a report which displays Customer Details for huge number of
Customers.
I use double sided printer but I do not want reports of two different
customers to be printed on same paper (front and back). So I need to have a
blank page printed out whenever a customer report ends on odd-numbered-page
(so that new Customer's Report starts on a odd-numbered-page, i.e. on a new
paper).
For the same I wrote:
Public temporaryCustomer As String
Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
Me![MyPageBreak1].Visible = False
temporaryCustomer = Me!CustomerNumber
End Sub
Private Sub PageHeader_Format(Cancel As Integer, FormatCount As Integer)
Me![MyPageBreak1].Visible = False
If temporaryCustomer <> Me!CustomerNumber Then
If Me.Page Mod 2 = 0 Then
Me![MyPageBreak1].Visible = True
End If
End If
temporaryCustomer = Me!CustomerNumber
End Sub
The result of the code is as follows:
Customer Number Actual Pages Need Blank Page Geetting Blank
Page
Customer1 3 YES
NO
Customer2 1 YES
YES
Customer3 1 YES
YES
Customer4 2 NO
NO
Customer5 2 NO
NO
Problem:
1. I do not get a desired blank page after Customer1
2. Customer 2 starts on wrong page
3. Although I get desired blank pages for all customers except Customer1,
they all get printed on wrong sides of the paper as Customer1 does not leave
desired blank page.
Can anybody help me solve this problem?
Thanx a million in advance.
S
I have a report which displays Customer Details for huge number of
Customers.
I use double sided printer but I do not want reports of two different
customers to be printed on same paper (front and back). So I need to have a
blank page printed out whenever a customer report ends on odd-numbered-page
(so that new Customer's Report starts on a odd-numbered-page, i.e. on a new
paper).
For the same I wrote:
Public temporaryCustomer As String
Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
Me![MyPageBreak1].Visible = False
temporaryCustomer = Me!CustomerNumber
End Sub
Private Sub PageHeader_Format(Cancel As Integer, FormatCount As Integer)
Me![MyPageBreak1].Visible = False
If temporaryCustomer <> Me!CustomerNumber Then
If Me.Page Mod 2 = 0 Then
Me![MyPageBreak1].Visible = True
End If
End If
temporaryCustomer = Me!CustomerNumber
End Sub
The result of the code is as follows:
Customer Number Actual Pages Need Blank Page Geetting Blank
Page
Customer1 3 YES
NO
Customer2 1 YES
YES
Customer3 1 YES
YES
Customer4 2 NO
NO
Customer5 2 NO
NO
Problem:
1. I do not get a desired blank page after Customer1
2. Customer 2 starts on wrong page
3. Although I get desired blank pages for all customers except Customer1,
they all get printed on wrong sides of the paper as Customer1 does not leave
desired blank page.
Can anybody help me solve this problem?
Thanx a million in advance.
S