i have a report with a control button. When this button is clicked, I need 2 copies of current report to be printed. Would someone help me with this please?
well one not eloquent solution is to go to the properties of the print button you put on the form, go to the event tab and click on the ... button to view the code under the on_click event procedure. Then copy the DoCmd.Open... line and paste a copy underneath the original line. That should execute the command to send the report to the printer twice. If it doesn't work let me know there is always a way.
On Error GoTo Err_CmdReport_Click
Dim intCopies As Integer
For intCopies = 1 To 2
DoCmd.OpenReport "YourReportNameHere", acViewNormal
Next
Exit_CmdReport_Click:
Exit Sub
Err_CmdReport_Click:
MsgBox Err.Description
Resume Exit_CmdReport_Click
Exit sub
I modified this a little as I have a text field and a couple of command buttons on the "driving" form that allow you to "spin" your copy count up or down (default of what ever you want.) Let me know if you want to get that fancy...
Gord
ghubbell@total.net
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.