Solved print 4 copies of a report through vba (1 Viewer)

Sneale

New member
Local time
Today, 15:17
Joined
Aug 26, 2019
Messages
26
Hello I have a form that I created to enter some data and them have a report print out when you click a button. I have the following code in the button.

Private Sub Command20_Click()
Const MESSAGETEXT = "No current record."
Dim strCriteria As String

strCriteria = "ID = " & Me.ID

If Not IsNull(Me.ID) Then
Me.Dirty = False
DoCmd.OpenReport "rptBOL", _
WhereCondition:=strCriteria

Else
MsgBox MESSAGETEXT, vbExclamation, "Invalid Operation"
End If
End Sub

I need the report to print with 4 copies. what do I need to add and where to get that to print the 4 copies? Thank you in advance
 

June7

AWF VIP
Local time
Today, 11:17
Joined
Mar 9, 2014
Messages
5,466
Open report to PrintPreview then use DoCmd.PrintOut command which has a Copies argument.

DoCmd.OpenReport "rptBOL", acViewPreview, , strCriteria
DoCmd.PrintOut , , , , 4
DoCmd.Close
 

Sneale

New member
Local time
Today, 15:17
Joined
Aug 26, 2019
Messages
26
Open report to PrintPreview then use DoCmd.PrintOut command which has a Copies argument.

DoCmd.OpenReport "rptBOL", acViewPreview, , strCriteria
DoCmd.PrintOut , , , , 4
DoCmd.Close
That worked great! thank you very much
 

Users who are viewing this thread

Top Bottom