Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 8th, 2006, 09:40 AM
Authorized User
 
Join Date: Apr 2006
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default Open Print Dialog

Hi!
I have aproblem with print dialog!
To be more specific I want to create a button which I can print but at first to select with which printer to use because I have 3 printers!

 
Old June 8th, 2006, 10:44 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I am not sure how to do that, but you can poll the printers, display them on a form, give the user a button to click to select the printer, change that printer to the default, print the item, and then change the original default printer back to the default.

If someone can't help you with this solution, let me know if you want to use my method.



mmcdonal
 
Old June 8th, 2006, 10:45 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

The solution may have to do with custom toolbar buttons.

mmcdonal
 
Old June 13th, 2006, 06:24 AM
Authorized User
 
Join Date: May 2006
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Ashfaque
Default

You can place following line of code in OnClick event of your command button that you will place on the form to view the report.
Let us say your printing report "A".
Then code will be

   Dim stDocName As String

    stDocName = "A"
    DoCmd.OpenReport stDocName, acPreview

    DoCmd.RunCommand acCmdPrint

Along with the preview of your report, this will open a print dialog box to let you choose the printer. You might not be able to see the contents of the report (may be blank page at first look) but it should print the data when you click OK button of print dialog.

Off course you must include the error handler.

HTH

Regards,
Ashfaque
 
Old July 16th, 2006, 02:41 AM
Friend of Wrox
 
Join Date: Jul 2005
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

chec out:

ACC: How to Change a Report's Printer Using Code
http://support.microsoft.com/?id=129397

and

How to use code to change a report's printer in Access
http://support.microsoft.com/default...b;en-us;208840

Boyd
"Hi Tech Coach"
Access Based Accounting/Business Solutions developer.
http://www.officeprogramming.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
get the printer name chosen in print dialog deep_ocean Classic ASP Basics 0 March 14th, 2007 10:27 AM
Print Dialog when Faxing rodmcleay General .NET 1 May 12th, 2006 07:59 AM
print the hidden page without the print dialog box kayzem Classic ASP Basics 0 April 21st, 2005 11:31 PM
open print dialog X-Ken VS.NET 2002/2003 4 July 26th, 2004 11:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.