change default printer of a report

  • Thread starter Thread starter Rodolfo Fontes
  • Start date Start date
R

Rodolfo Fontes

Hi group,

I've done a form that can choose between avaibles objects and printers.
When I select a report early configured to printer "X", and i choose a
printer "Y", an error message appears, to choose a printer.
Is there anyway to select a blank printer for a report? or to do not
appear this message?

Access Version: 2000

ps: I didn't put the error message over here, since my office is portuguese
(Brasil).

Thanks,
Rodolfo Fontes
 
I think the way to approach this is to set the report to
print to the default printer and than select an other
printer by using the file -print menu options.
The way to set the report to print to the default printer
is to open the report in design view, than select the
file - page setup option, click on the page tab and click
at the default printer option checkbox.
Hope this helps.
Fons
 
I think it's more than that as the error message just give the option to
print on the default printer of the system (windows) or to select one. I can
select, but since i've already selected one on the form, i wanna force on
that printer without warnings.
Do you know something?

Thanks for helping
Rodolfo Fontes
 
Rodolfo, did this change anything, will your report print
to your default printer?
Fons
 
No, the only thing that changes is that with this option, the report will be
set to a specified printer...
Even with this, that warning message appears while choosing another printer.

Rodolfo Fontes
 
I think I do not understand exactly when you get the
error. Is this while you are previewing the report and
than slecting print from the file menu? And what is the
translation of the error message?
Do you have the proper printer drivers installed for each
of the desktops?
Fons
 
I've done a form where the user can select a printer to print the selected
report.
The selected report is set to use a specified printer. But as we use the
software on WTS (Windows Terminal Services) the printer name is always
changing, adding "printer xxx on sesson1", "printer xxx on sesson2", and
on...
This Form, where the user can choose the report and the printer to print it,
was done for that case.
So, the warning message appears and give the option, to choose between:
1 - use the default printer (sometimes the user can set another one, so this
isn't helpfull)
2 - Cancel (don't print)
3 - configure (here you go to the page setup settings, where you can choose
AGAIN or to print on default printer or selected printer)
4 - help

Sorry for not passing this information early.

Thanks,
Rodolfo Fontes
 
The best solution:


First, leave ALL REPORTS set to DEFAULT PRINTER.

Next:

In your form that prompts the user for the printer, you simply SET the
default printer,a nd then print the report.

When done, you simply set the printer back to the previous printer
setting.

You don't mention what version of ms-access. Acces2002 and later has a built
in printer object that lets you change the printer.

If you are using an earlier version, then grab my printer switch code.

So, just remember to leave ALL REPORTS to DEFAULT printer (this means that
you do NOT set a specify printer for each report).
You don't mention what version\ of ms-access.

So, In access 2002 and later, there is a built in printer object, and it
lets you switch the printer with ease.

You can use:

Set Application.Printer = Application.Printers("HP LaserJet Series II")


The above means you don't need my code.

So, to save/switch, you can use:

dim strDefaultPrinter as string

' get current default printer.
strDefaultPrinter = Application.Printer.DeviceName

' switch to printer of your choice:

Set Application.Printer = Application.Printers("HP LaserJet Series II")

do whatever.

Swtich back.

Set Application.Printer = Application.Printers(strDefaultPrinter)


If you are using a earlier versions, then you can use my lightweight printer
switch code here:

http://www.attcanada.net/~kallal.msn/msaccess/msaccess.html
 
Hi:

I downloaded and inserted your lightweight printer form..

It appears to be working fine, but I need to set it up in a macro.

I run this macro that prints a number of reports. I inserted the form at
the beginning of the macro, the form opens, but the rest of the macro runs
before I can change printers.

How do I insert this form into this macro and wait for a response before
continuing the remainder of the macro?

Thanks in advance.

Dave K
 
Back
Top