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!

How to duplicate report that is on the upper half to lower half of pag 1

Status
Not open for further replies.

ffleitas

Technical User
Mar 15, 2001
85
US
Hello programmers,


How would I go about a report that is half the size of an 8 1/2 x 11 laser printer sheet print the same information that is on the upper half to the lower half of the same sheet in order to save paper and print on the upper half page one and the lower half page two?

Thank you,
Felix

 
Felix
I am wondering if there is a Microsoft Knowledge Base article on printing mulptiple copies of a report from a form.

I remember doing this once by setting up a form to drive the report. Then the report's Open event referenced the control on the Form, and the Print event on the Detail section of the report set up the code for whether to print 1 copy of the record or 2 copies of the record on the page.

Tom
 
Thanks for responding. I tried looking for it in Microsoft's knowledgebase but had no luck. Do you happen to have the Article Number?

Thanks,
Felix
 
Felix
I couldn't find the Knowledge Base article, and am no longer sure where I found the code when I wanted to do it. But I did manage to find my old program where I had done this originally.

Again, your first step is to make up a form that drives the report. On the form will be only 2 things. One will be an unbound text box in which you can put the # of copies you wish of each record. The second will be a command button to open the report, in either Preview or Print mode whichever you wish. The last piece goes on the Open event for the report.

Then here is the code for your report. You will see that the first 2 lines go at the top of your coding, just under Option Explicit. The next piece goes on the Print event for your Detail section.

Dim intPrintCounter As Integer
Dim intNumberRepeats As Integer
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
' Note: intNumberRepeats and intPrintCounter are initialized
' in the report's OnOpen event.
If intPrintCounter < intNumberRepeats Then
intPrintCounter = intPrintCounter + 1
' Do not advance to the next record.
Me.NextRecord = False
Else
' Reset intPrintCounter and advance to next record.
intPrintCounter = 1
Me.NextRecord = True
End If
End Sub


Private Sub Report_Open(Cancel As Integer)
intPrintCounter = 1
intNumberRepeats = Forms!frmPrintReport!Text0
End Sub

One thing...I haven't worked this out so you can print the page # on, as you wished. You will have to play around with that. My report didn't have any page headers or footers, as the records were going on a pre-printed form.

Good luck. Hope this helps point you in a good direction.

Tom
 
One more thing I neglected to mention. In your report design, go into the Page Setup and Columns, and set the Column height to something less than 5 1/2 inches. You will have to experiment to get it to show right.

Tom
 
I just found the Knowledge Base article. I was looking for &quot;print multiple copies of report&quot; whereas I should have been looking for &quot;print multiple copies of record.&quot;

The Knowledge Base article is 207664

Tom
 
Felix
I tinkered around last night with the second part of your problem - how to get the top half of the page to show &quot;page 1&quot; and the bottom half to show &quot;page 2.&quot;

I couldn't get either page headers or report headers to show on the bottom half of the page. Actually, that makes sense, because what is happening is that 2 copies of the record are being made, not 2 copies of the report page.

The solution seems to be to put everything in the Detail section. Then at the top right of the Detail section put an unbound text box. In either the Format or the Print event for the Detail section, put code &quot;If intPrintCounter = 1 Then Me.TextBox (or whatever its right name is) = &quot;Page 1&quot; and then logic for Page 2.

Just thought I would mention it.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top