Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print multiple copies of a report???

Status
Not open for further replies.

ind

Programmer
Mar 9, 2000
121
US
I have set up a command button on a form to open a print dialog screen with (4) choices of reports to print and the type of output (print or print preview). I want the user to be able to print more than one copy of the report if necessary. How can I accomplish this?<br><br>Heres the code to choose the reports and type of output:<br><br>Private Sub CmdPrint_Click()<br>Dim ReportDest As String<br><br>Me.Visible = False<br><br>If Me!TypeOfOutput = 1 Then<br>ReportDest = acNormal<br>Else<br>ReportDest = acPreview<br>End If<br><br>If Me!chkLabel = -1 Then<br>DoCmd.OpenReport &quot;rptFolderLabel&quot;, ReportDest<br>End If<br>If Me!chkOffOrder = -1 Then<br>DoCmd.OpenReport &quot;rptOfficeOrder&quot;, ReportDest<br>End If<br>If Me!chkShopOrder = -1 Then<br>DoCmd.OpenReport &quot;rptJobCostReport&quot;, ReportDest<br>End If<br>If Me!chkTimeSheet = -1 Then<br>DoCmd.OpenReport &quot;rptProjectTimeSheet&quot;, ReportDest<br>End Sub
 
put a text box on your form for them to key in a number<br>then add a &quot;For&quot; above your code and a &quot;Next&quot; below.<br>like so:<br>---------------<br>&nbsp;&nbsp;&nbsp;&nbsp;For A = 1 To Val(Me!Text2)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Me!chkLabel = -1 Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.OpenReport &quot;rptFolderLabel&quot;, ReportDest<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Me!chkOffOrder = -1 Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.OpenReport &quot;rptOfficeOrder&quot;, ReportDest<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Me!chkShopOrder = -1 Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.OpenReport &quot;rptJobCostReport&quot;, ReportDest<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Me!chkTimeSheet = -1 Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.OpenReport &quot;rptProjectTimeSheet&quot;, ReportDest<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If&nbsp;&nbsp;'&lt;&lt;&lt;&lt; In your code you forgot the last End If<br>&nbsp;&nbsp;&nbsp;&nbsp;Next<br>----------------------- <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Doug,<br><br>I tried it and got the error Variable not defined<br>on For A = 1 To Val(Text2) line of code
 
I still help on this erros
 
put dim A as variable near the top of the code.<br>Make sure text2 is same name as text box you created on the form for them to enter number of copies into.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top