Link to home
Avatar of Sheils
SheilsFlag for Australia

asked on

How do I determine which printer is activated by a report.

Ok That worked fine.

Know, once I fix the problem with my pdf writer I am going to revert to previous system. How do I determine whether the report prints to a pdf document or to my printer.

Cheers
SOLUTION
Avatar of nico5038
nico5038
Flag of Netherlands image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Jeffrey Coachman
sb9,



So anytime you Open the Report, (In Print Preview or Design View) Access will check to see if the Printer it was associated with is the default (current) printer.
If not, you will get a message like the screenshot I have attached.

So with that in mind, I do not know if there is a way to pedict ahead of time what printer a Report is associated with.
(Since you can't open the Report to check)

JeffCoachman
Printer.JPG
Avatar of Sheils

ASKER

You've shed some light on an issue that is as clear as mud. Thanks
Avatar of Sheils

ASKER

Thanks
ASKER CERTIFIED SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
puppydogbuddy, nico5038,

What are you two "rouge" members doing here?
LOL.

Seriously, it is great to hear from you guys every once in a while.

What is curious to me is that I can't think of a way to tell what printer a Report is associated with ahead of time.
Which I believe is what the original question is.
So in this regard I see the askers point.

At any point in time you can select a report and want to print it.
However you dont know what printer it is associated with ahead of time.
If the report happens to be associated with a Printer that is not the default printer, you will receive the message I posted.

So, yes, you can change the printer, but then again, how would you know:
-If the printer needed to be changed in the first place.
-Which one of the multiple printers available should you use (Brother HL-2000e, or the Brother HL-2000es)
:-O

So I guess "my" question is:
Is there any way to have Access temporarily change the printer based on the printer that is assigned to the Report?
So when you click "Print", it always goes to the correctly assigned printer?

Or am I just missing something here?

JeffCoachman
Hi Jeff,

Guess it's time to check the samples from the Access Cookbook.
Chapter 01 shows the retrieval of a list of installed printers and chapter 2 the setting and retrieval of the default ouput device.
Chapter 06 will show how to retrieve the report's (or form's) selected printer.

Need to know more

Nic;o)
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Need to check the modules, see the basPrtDevMode function acbGetDevMode that accesses the prtDevMode property of the form/report object.

Piece of cake for you Jeff

Nic;o)
Avatar of Sheils

ASKER

plenty of interesting stuff have come out of this. I am increasing the point because this question seems harder than I originally thought and so many experts to share the points.

puppydogbuddy That's a great link you send. Keep them coming.


Cheers
Nic;o),

"Piece of cake for you Jeff"

ummm... OK,

...I think that piece of cake just went stale!

Enjoy the rest of the weekend!
;-)

Jeff
Avatar of puppydogbuddy
puppydogbuddy

Hi Jeff/Nico/sb9,

Just got home, and see I've missed most of the action.  Congrats to Jeff for being one of leaders on EE for this year.  Did you guys download the demo. Mdb file and also, note the following excerpt from the link I gave you.

The UseDefaultPrinter property returns a Boolean value when you read it that is True if the no changes to printer settings have been saved with the form or report, and is False if any printer setting has been saved with the form or report.

You can only set the UseDefaultPrinter property when a form or report is open in Design View. The following code fragment from the ClearFormReportSettings procedure in the PrinterDemo.mdb sample download opens each of the reports in the current project and clears any report that has saved settings
puppydogbuddy,

"Congrats to Jeff for being one of leaders on EE for this year."
Thanks!
Well with Experts like you and Nico not being so active here anymore, it's easy!
;-)

Great sample,

But I am still curious to know if you can get a listing of all Reports *and* what printer they are associated with.

I did not see a clear way to do that in the sample.

Or did I miss something?

Jeff
hi Jeff,
See comment from my first post:
             
It should be noted that since only the last setting is saved, you would have to maintain a table to track the printer used by a report on a historical basis.
Hi Jeff,

Check: http://msdn.microsoft.com/en-us/library/aa173221(office.11).aspx
Guess creating a loop through the application's reports/forms is a piece of cake for you <LOL>

Nic;o)