Set Printer Problem

R

Rosemary

Hi,

We have Windows XP and MS Office 2003 in a network environment. In my
Access application, I have my reports hard coded to print to a specific
printer. Last week IT replaced our network printers with new ones. They've
done this in the past, and all I have to do is put the name of the new
printer in the code (in this case, printer #L030647). But this time it isn't
working - the new printer name doesn't come up as the default when I do File
- Print. Instead, I get a printer named "Microsoft XPS Document Writer",
which I've never seen happen before. Below is the set printer code. Where
might I look for the problem?

Set savePrinter = Application.Printer
Set Application.Printer = Application.Printers("\\gesprint\L030647")
strWhere = "[JobId] = " & Me!JobId
stDocName = "Job Ticket"
DoCmd.OpenReport stDocName, acViewPreview, , strWhere
Set Application.Printer = savePrinter

Please let me know if I can supply any further information.

Thanks!
Rosemary
 
K

Ken Snell \(MVP\)

My guess is that you have not installed the new printer onto the PC, which
is why you don't see it in the dropdown for printer choice when you manually
look at File | Print. Unless the printer is installed (driver is installed)
on the PC where you're running the ACCESS database, your code will not work.
 
R

Rosemary

Hi Ken,

Sorry, I didn't explain fully ... I did actually install the new printer.
It does appear in my drop-down list, and I can select it and print to it
fine. The problem is that I used to be able to specify it as the default
printer, so that I didn't have to scroll down and select it each time I
printed ...

Thanks for your reply.

Regards,

Ken Snell (MVP) said:
My guess is that you have not installed the new printer onto the PC, which
is why you don't see it in the dropdown for printer choice when you manually
look at File | Print. Unless the printer is installed (driver is installed)
on the PC where you're running the ACCESS database, your code will not work.

--

Ken Snell
<MS ACCESS MVP>


Rosemary said:
Hi,

We have Windows XP and MS Office 2003 in a network environment. In my
Access application, I have my reports hard coded to print to a specific
printer. Last week IT replaced our network printers with new ones.
They've
done this in the past, and all I have to do is put the name of the new
printer in the code (in this case, printer #L030647). But this time it
isn't
working - the new printer name doesn't come up as the default when I do
File
- Print. Instead, I get a printer named "Microsoft XPS Document Writer",
which I've never seen happen before. Below is the set printer code.
Where
might I look for the problem?

Set savePrinter = Application.Printer
Set Application.Printer = Application.Printers("\\gesprint\L030647")
strWhere = "[JobId] = " & Me!JobId
stDocName = "Job Ticket"
DoCmd.OpenReport stDocName, acViewPreview, , strWhere
Set Application.Printer = savePrinter

Please let me know if I can supply any further information.

Thanks!
Rosemary
 
P

Paul Shapiro

Allen Browne has documented this as a known bug in Access 2007.
http://allenbrowne.com/Access2007.html#Bugs

He includes a link to a MS Hotfix that purports to fix the issue:
http://support.microsoft.com/kb/950488

There may be a similar post-SP3 fix for Access 2003. It seemed to me that
SP3 brought some of the new Access 2007 bugs into Access 2003.

Rosemary said:
Hi Ken,

Sorry, I didn't explain fully ... I did actually install the new printer.
It does appear in my drop-down list, and I can select it and print to it
fine. The problem is that I used to be able to specify it as the default
printer, so that I didn't have to scroll down and select it each time I
printed ...

Thanks for your reply.

Regards,

Ken Snell (MVP) said:
My guess is that you have not installed the new printer onto the PC,
which
is why you don't see it in the dropdown for printer choice when you
manually
look at File | Print. Unless the printer is installed (driver is
installed)
on the PC where you're running the ACCESS database, your code will not
work.

--

Ken Snell
<MS ACCESS MVP>


Rosemary said:
Hi,

We have Windows XP and MS Office 2003 in a network environment. In my
Access application, I have my reports hard coded to print to a specific
printer. Last week IT replaced our network printers with new ones.
They've
done this in the past, and all I have to do is put the name of the new
printer in the code (in this case, printer #L030647). But this time it
isn't
working - the new printer name doesn't come up as the default when I do
File
- Print. Instead, I get a printer named "Microsoft XPS Document
Writer",
which I've never seen happen before. Below is the set printer code.
Where
might I look for the problem?

Set savePrinter = Application.Printer
Set Application.Printer = Application.Printers("\\gesprint\L030647")
strWhere = "[JobId] = " & Me!JobId
stDocName = "Job Ticket"
DoCmd.OpenReport stDocName, acViewPreview, , strWhere
Set Application.Printer = savePrinter
 
R

Rosemary

Ok, thanks very much,


Paul Shapiro said:
Allen Browne has documented this as a known bug in Access 2007.
http://allenbrowne.com/Access2007.html#Bugs

He includes a link to a MS Hotfix that purports to fix the issue:
http://support.microsoft.com/kb/950488

There may be a similar post-SP3 fix for Access 2003. It seemed to me that
SP3 brought some of the new Access 2007 bugs into Access 2003.

Rosemary said:
Hi Ken,

Sorry, I didn't explain fully ... I did actually install the new printer.
It does appear in my drop-down list, and I can select it and print to it
fine. The problem is that I used to be able to specify it as the default
printer, so that I didn't have to scroll down and select it each time I
printed ...

Thanks for your reply.

Regards,

Ken Snell (MVP) said:
My guess is that you have not installed the new printer onto the PC,
which
is why you don't see it in the dropdown for printer choice when you
manually
look at File | Print. Unless the printer is installed (driver is
installed)
on the PC where you're running the ACCESS database, your code will not
work.

--

Ken Snell
<MS ACCESS MVP>


Hi,

We have Windows XP and MS Office 2003 in a network environment. In my
Access application, I have my reports hard coded to print to a specific
printer. Last week IT replaced our network printers with new ones.
They've
done this in the past, and all I have to do is put the name of the new
printer in the code (in this case, printer #L030647). But this time it
isn't
working - the new printer name doesn't come up as the default when I do
File
- Print. Instead, I get a printer named "Microsoft XPS Document
Writer",
which I've never seen happen before. Below is the set printer code.
Where
might I look for the problem?

Set savePrinter = Application.Printer
Set Application.Printer = Application.Printers("\\gesprint\L030647")
strWhere = "[JobId] = " & Me!JobId
stDocName = "Job Ticket"
DoCmd.OpenReport stDocName, acViewPreview, , strWhere
Set Application.Printer = savePrinter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top