Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Separate Records using Duplex Print.

Status
Not open for further replies.

xentaur

Programmer
Nov 17, 2003
35
AU
Dear Gurus

BACKGROUND:
Client database for which weekly contact sheets are generated via an Access Report. The Report contains a case note history in the form of a subreport populated by a query. The Sub report is in the bottom half of the detail section of the report. The sub report for the casenotes is set to Can Grow to allow all case notes to appear. Those case notes may then spill over to a second page.

ISSUE:
In an effort to reduce our environmental impact I am trying to have these reports duplex print. The following code activates a page break control placed in the page footer of the report so that if the case notes don't actually spill over to Page 2 it will generate a blank page thus re-aligning the new record with with a new duplex-printed sheet(acknowledgement to Balaji Ramanathan @ UtterAccess for the original code).

Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If Me.Page Mod 2 = 0 Then 
Me.PgBrk01.Visible = True
Else
Me.PgBrk01.Visible = False
End If
End Sub

duplex printing is triggered on the open event of the report and reset on close.

For records that have up to a maximum of two pages this code works fine. On the rare occasion, however, case notes may spill over to a third page. On these occasions the code will not insert a blank page at page 4 and instead prints the first page of the next record on the reverse side of the third page of the previous record. As these records need to be filed indvidually I can't have data for two records on the same sheet of paper.

I've tried experimenting with additional page breaks, looking to see where PrintCount is - both on its own and in comparison to Me.Page - but to no avail.

I Look forward to your suggestions.

Xentaur
 
If Me.Page Mod 2 = 1 Then
Me.PgBrk01.Visible =False
Else
Me.PgBrk01.Visible = true
End If
 
Thanks for that that however I had tried that variation with no success until just now when I placed the page break at the top of the detail section instead of at the bottom.

Things do look upside down from here in Australia!

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top