M
Maurita
Hi All, hope you can help me with a rather strange problem. I have a
recipe database where I click on a command button (Command161) and the
current record is printed in a form (Print Recipe - Report). The
recipe used to print fine until I purchased a new printer, Lexmark
Platinum Pro 905. When I click on the command button, I receive the
following error message, "The object may have been sent to a printer
that is unavailable." After research, Lexmark does have an issue with
it's printers and Access applications. After researching your site, I
was lucky enough to find code to help with this issue, which now I am
able to view the report by setting my printer as a PDF printer (PDF
Complete). My problem now comes in trying to switch back to the
Lexmark printer to print my document [Lexmark Pro900 Series (USB)].
No matter how I try to code the printer, I keep getting errors. Could
someone please let me know what I am doing wrong. Thank you so very
much.
Maurita
Private Sub Command161_Click()
Set Application.Printer = Application.Printers("PDF Complete")
Dim strDefaultPrinter As String
strDefaultPrinter = Application.Printer.Lexmark_Pro900_Series_(USB)
If Me.Dirty Then Me.Dirty = False
DoCmd.OpenReport "Print Recipe - Report", acViewPreview, , "[RecipeID]
= " & [RecipeID]
Set Application.Printer = Application.Printers(strDefaultPrinter)
End Sub
recipe database where I click on a command button (Command161) and the
current record is printed in a form (Print Recipe - Report). The
recipe used to print fine until I purchased a new printer, Lexmark
Platinum Pro 905. When I click on the command button, I receive the
following error message, "The object may have been sent to a printer
that is unavailable." After research, Lexmark does have an issue with
it's printers and Access applications. After researching your site, I
was lucky enough to find code to help with this issue, which now I am
able to view the report by setting my printer as a PDF printer (PDF
Complete). My problem now comes in trying to switch back to the
Lexmark printer to print my document [Lexmark Pro900 Series (USB)].
No matter how I try to code the printer, I keep getting errors. Could
someone please let me know what I am doing wrong. Thank you so very
much.
Maurita
Private Sub Command161_Click()
Set Application.Printer = Application.Printers("PDF Complete")
Dim strDefaultPrinter As String
strDefaultPrinter = Application.Printer.Lexmark_Pro900_Series_(USB)
If Me.Dirty Then Me.Dirty = False
DoCmd.OpenReport "Print Recipe - Report", acViewPreview, , "[RecipeID]
= " & [RecipeID]
Set Application.Printer = Application.Printers(strDefaultPrinter)
End Sub