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

Displaying print dialog before printing report

Status
Not open for further replies.

DreewToo

Programmer
Dec 20, 1999
128
US
I am trying to figure out how to show the print dialog before sending a report to print.&nbsp;&nbsp;After an hour, I'm sending out for pizza and help.&nbsp;&nbsp;Is there a simple way to do this?<br><br>TY,<br>Drew
 
And why are we wanting to do this. Is it because they are sending the report to the wrong printer.<br><br>If so, check out my FAQ:<br><A HREF=" TARGET="_new"> not, do you live in Florida I'll be over for some Pizza. <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.
 
Thank you for responding, Doug.&nbsp;&nbsp;I've gone thru your faq, and I think what I'm looking for is a little different.<br><br>I was hoping to open the dialog and pass the report name and criteria with a button, allowing for the selection of the printer or number of copies.<br><br>More background to this problem I'm having:<br><br>Developing away from the roll-out environment, and the reports showing up on the default printer settings (I don't know what printers will be used for the reports).&nbsp;&nbsp;<br><br>I've also been searching a few hours now for a good piece of code to instruct the printer on paper size and orientation, without success.&nbsp;&nbsp;I'm thinking common dialog control, but can't find any help files at all on them.<br><br>Florida, hmmm...Jersey here, pizza capital of the US.&nbsp;&nbsp;<br><br>Drew
 
Add the following code to the On Activate event of the report:<br><br>Private Sub Report_Activate()<br>On Error GoTo Err_Report_Activate<br><br>DoCmd.RunCommand acCmdPrint<br>DoCmd.Close acReport, Me.Name<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>Err_Report_Activate:<br>&nbsp;&nbsp;&nbsp;&nbsp;Resume Next<br>&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.Close acReport, Me.Name<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>End Sub<br><br>Open the report with the acViewNormal argument. The above code code will cause the print dialog box to show. After the user enters the choices and clicks print, the report will then print according to the choices, but the report will remain hidden during the process.<br><br>HTH<br>RDH <p>Ricky Hicks<br><a href=mailto: rdhicks@mindspring.com> rdhicks@mindspring.com</a><br><a href= > </a><br>
 
Thanks rhicks,

I know this was posted a long time ago but I used your code and it worked great. I actually called it from a custom menu bar and it can be used for all my reports.

Thank you very much,
jamminjaymeyer
 
I am learning access and need some help. When i use the print report button it prints every record. I only want the report that is being displayed not the whole data base.


Thanks
 
Hi !!

I tried your code DougP, but it doesn't work for me !!!

If I open the report with AcViewNormal argument, the Activate function isn't called (I looked with step by step execution), so the report is printed but the dialog isn't shown !!!

I tried with acViewPreview, but the function open_form is called and not Activate

What code do you use to open the report ???

I use :
DoCmd.OpenReport &quot;Reunion_Commerciale&quot;, acViewNormal

So, can you help me ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top