print multiple copies of the same report

eyalco

Registered User.
Local time
Today, 01:22
Joined
Jul 24, 2007
Messages
50
I have a report which I need to copy in 2 different lables. I've set a table with numbers from 0-10 (0 gets "original and all the others get "copy"). The caption is changed by IIF - so now all is ok.

The problem is : when users presses a print button, a small form pops up asking number of copies to print (my intention is to print from the table the 0 + the number of copies, so if chosen 2 copies, we'll get 1 original + 2 copies).
What happens is that if user writes 2 copies, I get all table printed twice(if I have 10 numbers in the table, I get 2 originals + 20 copies).

Need help please.
Thanks.
 
Thanks for the answer.
Here's the code I'm using (based on your code):

Private Sub PRINTREP_Click()
On Error GoTo Err_PRINTREP_Click

Dim strDocName As String
Dim numCopies As Integer
Dim strLinkCriteria As String

strDocName = "RPT_INVOICE"

strCriteria = "[invoice_no]= " & Forms![FRM_INVOICE]![INVOICE_NO]

numCopies = Me![COPY]

DoCmd.SelectObject acReport, strDocName
DoCmd.PrintOut acSelection, , , , numCopies
DoCmd.CLOSE acReport, strDocName

Exit_PRINTREP_Click:
Exit Sub

Err_PRINTREP_Click:
MsgBox Err.Description
Resume Exit_PRINTREP_Click

End Sub

It's still printing everything there is there - regardless of what number I specify.

The [copy] is where I place the numbers I'm interested in.

Can you assist please?

Thanks.
 

Users who are viewing this thread

Back
Top Bottom