report printout

G

Guest

Hi I use this code to print report from from What must I include to specify
printing 3 copies instead of pressing the print command 3 rimes?

Private Sub printwaybill_Click()
On Error GoTo Err_printwaybill_Click

Dim stDocName As String

stDocName = "waybillrpt"
DoCmd.OpenReport "waybillrpt", acPrint, , "[waybillid]=" & [WaybillID]
Me.Visible = True

Exit_printwaybill_Click:
Exit Sub

Err_printwaybill_Click:
MsgBox Err.Description
Resume Exit_printwaybill_Click

End Sub
 
G

Guest

On top of David's suggestion, you could use some sort of loop

Private Sub printwaybill_Click()
On Error GoTo Err_printwaybill_Click

Dim stDocName As String
Dim i as integer
i =1
stDocName = "waybillrpt"
For i = 1 to 3
DoCmd.OpenReport "waybillrpt", acPrint, , "[waybillid]=" & [WaybillID]
next i
Me.Visible = True

Exit_printwaybill_Click:
Exit Sub

Err_printwaybill_Click:
MsgBox Err.Description
Resume Exit_printwaybill_Click

End Sub
Both will work, just a matter of preferance.
 

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

Similar Threads

Report Missing Data 2
Report printing 15
Report printing 1
Opening a Filtered Report from a Form Button 3
Report printing problem 2
preview a report 5
Jet Engine Error Message 2
Slight Adjustment needed to Code 3

Top