Selecting a specific printer (1 Viewer)

ptaylor-west

Registered User.
Local time
Today, 19:08
Joined
Aug 4, 2000
Messages
193
What code do I need to use to get a report to print to a specific printer ?
 

RossG

Registered User.
Local time
Today, 19:08
Joined
Apr 18, 2001
Messages
21
Could you choose the printer via the Print dialogue box?

If so, in the reports OnActivate event use DoCmd.RunCommand acCmdPrint
 

ptaylor-west

Registered User.
Local time
Today, 19:08
Joined
Aug 4, 2000
Messages
193
Surely this would use whatever printer had been selected previously - what I want to do is get it to select a specific printer, for example I want to print a report that comes out on a HP printer in the back office and another report on a Brother printer in the front office so I need to specify the printer name in the DoCmd - but how ?
 

RossG

Registered User.
Local time
Today, 19:08
Joined
Apr 18, 2001
Messages
21
Sorry, I misunderstood.

The code above will bring up the Print Dialogue box, in which you manually choose the printer, number of copies etc.

As for selecting a printer in code....sorry, I'm up to speed on that (yet?).
 

ptaylor-west

Registered User.
Local time
Today, 19:08
Joined
Aug 4, 2000
Messages
193
Thanks, I had seen an article on PrtDevNames and intended to follow it through as it seems to be exactly what I need, but it will need a bit of time for me to get my head round it and test it out as it is quite advanced stuff for me. But I am grateful for your help and pointing me to the relevant articles. If however there is anyone out there who knows the exact code I need it would save me some time.
 

Carol

Registered User.
Local time
Today, 19:08
Joined
Jan 15, 2000
Messages
280
It seems to me that if you open up your report in design view and select page setup, and then the Page tab, there is an area where you can select a specific printer to always send the report to. I have used this to automatically have a customers shipping request report sent to the shipping office located in the warehouse.



[This message has been edited by Carol (edited 06-17-2001).]
 

ptaylor-west

Registered User.
Local time
Today, 19:08
Joined
Aug 4, 2000
Messages
193
This solution is perfect if you only want to send the report to the same output device every time but sometimes I need to send the report to a different device, so what I would like to do is put two command buttons on the report that you could select to send the report to different printers.
 

RossG

Registered User.
Local time
Today, 19:08
Joined
Apr 18, 2001
Messages
21
Maybe not a very neat solution but on the form that calls the report could you have 2 command buttons, with each one opening a different version of the report?

The different report versions then have the appropriate printers saved as the defaults.

Label the command buttons with the appropriate printer name - 'should' be pretty user-friendly!
 

ptaylor-west

Registered User.
Local time
Today, 19:08
Joined
Aug 4, 2000
Messages
193
The problem is the form IS the report and stores the information directly into a table rather than output through a report process, I will look at it but it may store both versions in the table which will be no good, thanks for your input.I may be asking for something that cannot be achieved, I have looked at macros etc but no physical solution seems to exist.
 

Users who are viewing this thread

Top Bottom