mulitiple copies of report based on field in query (1 Viewer)

wilkob

Registered User.
Local time
Today, 15:49
Joined
Jan 10, 2005
Messages
86
I have made a query to print a report.
The report is actually a label that should print for each parcel in a shipment.

In the query there is a field for the number of parcels and based on that number a number of copies of the report should print.
For example: 4 parcels means 4 copies of the label/report
3 parcels means 3 copies of the label/report

Can someone help me out here?
 

Steve2003

Registered User.
Local time
Today, 14:49
Joined
Jun 20, 2003
Messages
16
Not sure if this is what you want.
Have you tried docmd.printout. Then adding how may copies you nedd by
docmd.printout copies:= howevermany

Steve
 

wilkob

Registered User.
Local time
Today, 15:49
Joined
Jan 10, 2005
Messages
86
what I want is the number of copies to come from a field from the query or form.
I have now the code set up to print 2 copies
NumCopies=2 but I want this to depend on the number entered in a field
 

Steve2003

Registered User.
Local time
Today, 14:49
Joined
Jun 20, 2003
Messages
16
set the howevermany to the field you want that contains how many copies you want.

eg docmd.printout copies:=me.numberofcopies

Hope this helps.
 

wilkob

Registered User.
Local time
Today, 15:49
Joined
Jan 10, 2005
Messages
86
I have now:

Private Sub Command68_Click()
On Error GoTo Err_Command68_Click

Dim stDocName As String

stDocName = "Label"
DoCmd.PrintOut Copies:=Me.Colli

Exit_Command68_Click:
Exit Sub

Err_Command68_Click:
MsgBox Err.Description
Resume Exit_Command68_Click

End Sub

But this prints about 20 copies of my form (probably because I have 20 records in my tabel)
 

Steve2003

Registered User.
Local time
Today, 14:49
Joined
Jun 20, 2003
Messages
16
Okay sorry bit of a mis-understanding.

Try.....

Private Sub Command68_Click()
On Error GoTo Err_Command68_Click

Dim stDocName As String

stDocName = "Label"
DoCmd.PrintOut Copies:=Me.Colli, Pageto:=me.currentrecord ,Pagefrom:=me.currentrecord

Exit_Command68_Click:
Exit Sub

Err_Command68_Click:
MsgBox Err.Description
Resume Exit_Command68_Click

End Sub

I have not tested this but it should only print the current page you are on and then the amount of copies you require.

Steve
 

Users who are viewing this thread

Top Bottom