Printing strange symbols between multicopy report

C

Claire

Hi all,
I have programmed in to a control on a form for it to print 11 copies of a
report when it is clicked. It worked just fine a few weeks ago (at least, I
thought it did) but the last three times it has been acting up. After
printing 9 copies it starts printing a bunch of pages of junk (symbols on the
top of the sheets, etc). I cancel that print job on the printer, and then it
prints one more copy, just fine. I have no real idea where the issue may be,
but here's my code pasted below:

Private Sub Print11_Click()
Dim intCounter As Integer
intCounter = 11
Do While intCounter > 0
DoCmd.OpenReport "38 Hour Report", acViewNormal
intCounter = intCounter - 1
Loop
End Sub

Thanks for any suggestions you may have!
~Claire
 
A

Allen Browne

Not sure what's causing this, Claire. It could be anything from a timing
issue (DoEvents?) to a bad printer cable.

But here's an alternative approach to print 11 copies of the report:

1. Create a little table with just one field:
CountID Number primary key
Save the table as (say) tblCount.
Enter 11 rows (the numbers 1 to 11.)

2. Open the query you use as the source of your report (or create a query if
it is bound directly to a table.) As well as whatever other table(s) you
need, add tblCount to the query. There must be no line joining tblCount to
any other table. This will give you 11 copies of every row. Save the query.

3. Open the report design view, and make sure the query is its RecordSource.
Open the Sorting And Grouping box. Insert CountID as the first row in the
dialog. Create a Group Header on CountID, and set the properties so this new
group header starts on a new page each time. (You may need to more whatever
you had in the Report Header section into the new CountID Group Header, so
it prints on each of the 11 copies.)

This is a very flexible approach. If you wish, you can print "Copy 1" etc on
each copy (using the CountID field to supply the number.) Alternatively, if
the 11 copies are for 11 people, you could add another text field to
tblCount with the person's name, and then print that name on the report.
 

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