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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print 2 copies of a report 1

Status
Not open for further replies.

mkphan

IS-IT--Management
Jan 9, 2001
18
US
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?

Thanks in advance,
Mk
 
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.

HTH,
JC
 
Hi Mk, you're just in time:

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top