A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Print multiple reports from first printer



 
 
Thread Tools Display Modes
  #1  
Old August 6th, 2008, 07:49 PM posted to microsoft.public.access.reports
ALEX
external usenet poster
 
Posts: 731
Default Print multiple reports from first printer

I am trying to write VBA on a form button on_click event that will open
report1 and allow the user to choose which printer he/she would like to use.
I would then like report1, report2, report3 and report4 to all print to that
printer, without the user having to keep picking the printer. I've tried for
hours and can't get this to work. Any suggestions are appreciated. Thank
you.
  #2  
Old August 7th, 2008, 02:43 AM posted to microsoft.public.access.reports
Allen Browne
external usenet poster
 
Posts: 11,706
Default Print multiple reports from first printer

If this is Access 2002 or later, you can set a printer like this:
Set Printer = Printers(1)

Access will then use that printer until you reset it to the Windows default
with:
Set Printer = Nothing

This assumes you have not set up the report to go to a particular printer
(using the Page Setup dialog in report design view), but that it is set to
go to the default.

You probably want to use the DeviceName of the printer rather than its
number. You can get its name in the Immediate Window with:
? Printers(1).DeviceName
and then use the name like this:
Set Printer = Printers("xxx")

For an example of how to create a combo box loaded with the user's current
printers, see:
http://allenbrowne.com/AppPrintMgt.html
That utility goes further than you want (assigning a custom property to a
report so it remembers which printer to use for that report), but it may be
worth downloading the sample to see how to load the combo and work with the
Printers collection.

For Access 2000 or earlier, this technique will not work. The page contains
links for A97 and A2000 databases to samples created by Albert Kallal
(Access MVP.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Alex" wrote in message
...
I am trying to write VBA on a form button on_click event that will open
report1 and allow the user to choose which printer he/she would like to
use. I would then like report1, report2, report3 and report4 to all print
to
that printer, without the user having to keep picking the printer. I've
tried for hours and can't get this to work.


  #3  
Old August 7th, 2008, 03:15 PM posted to microsoft.public.access.reports
ALEX
external usenet poster
 
Posts: 731
Default Print multiple reports from first printer

Thank you Allen. Your site is always so helpful.

"Allen Browne" wrote:

If this is Access 2002 or later, you can set a printer like this:
Set Printer = Printers(1)

Access will then use that printer until you reset it to the Windows default
with:
Set Printer = Nothing

This assumes you have not set up the report to go to a particular printer
(using the Page Setup dialog in report design view), but that it is set to
go to the default.

You probably want to use the DeviceName of the printer rather than its
number. You can get its name in the Immediate Window with:
? Printers(1).DeviceName
and then use the name like this:
Set Printer = Printers("xxx")

For an example of how to create a combo box loaded with the user's current
printers, see:
http://allenbrowne.com/AppPrintMgt.html
That utility goes further than you want (assigning a custom property to a
report so it remembers which printer to use for that report), but it may be
worth downloading the sample to see how to load the combo and work with the
Printers collection.

For Access 2000 or earlier, this technique will not work. The page contains
links for A97 and A2000 databases to samples created by Albert Kallal
(Access MVP.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Alex" wrote in message
...
I am trying to write VBA on a form button on_click event that will open
report1 and allow the user to choose which printer he/she would like to
use. I would then like report1, report2, report3 and report4 to all print
to
that printer, without the user having to keep picking the printer. I've
tried for hours and can't get this to work.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:46 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.