latex88
Registered User.
- Local time
- Today, 10:14
- Joined
- Jul 10, 2003
- Messages
- 198
I have small network setup between two computers and five receipt printers. I have .accdr front end on both computers with .accdb back end stored on Computer B.
Computer A: Front end and a printer (Printer A)
Computer B: Front end, back end and four printers (Printer A,B,C,D)
I have gotten codes from the web that work quite well when Computer A printing to its own printer and to all the printers connected to Computer B. The code is below. The issue I have is that when I execute the same sub routine on Computer B that need to print to the same printers, it doesn't seem to like the way the printers are pointed. It will print rptA fine, but it shuts down after that. I suspect it does not like the way the printers' path are referenced since they are considered local printers to Computer B?
Computer A: Front end and a printer (Printer A)
Computer B: Front end, back end and four printers (Printer A,B,C,D)
I have gotten codes from the web that work quite well when Computer A printing to its own printer and to all the printers connected to Computer B. The code is below. The issue I have is that when I execute the same sub routine on Computer B that need to print to the same printers, it doesn't seem to like the way the printers are pointed. It will print rptA fine, but it shuts down after that. I suspect it does not like the way the printers' path are referenced since they are considered local printers to Computer B?
Private Sub cmdPrint_Click()
DoCmd.OpenReport "rptOne", acViewNormal ‘Print to local printer (Printer A)
Dim defPrinter As String, NewPrinter As Printer
defPrinter = Application.Printer.DeviceName
Set NewPrinter = Application.Printers("\\ComputerB\PrinterB") ‘Prints to PrinterB
Set Application.Printer = NewPrinter
DoCmd.OpenReport "rptTwo ", acViewNormal
DoCmd.Close acReport, " rptTwo ", acSaveNo
Set NewPrinter = Application.Printers(defPrinter)
Set Application.Printer = NewPrinter
Dim defPrinter2 As String, NewPrinter2 As Printer
defPrinter2 = Application.Printer.DeviceName
Set NewPrinter2 = Application.Printers("\\ComputerB\PrinterC) ‘Prints to PrinterC
Set Application.Printer = NewPrinter2
DoCmd.OpenReport " rptThree ", acViewNormal
DoCmd.Close acReport, " rptThree ", acSaveNo
Set NewPrinter2 = Application.Printers(defPrinter)
Set Application.Printer = NewPrinter2
Dim defPrinter3 As String, NewPrinter3 As Printer
defPrinter3 = Application.Printer.DeviceName
Set NewPrinter3 = Application.Printers("\\ComputerB\PrinterD") ‘Prints to PrinterD
Set Application.Printer = NewPrinter3
DoCmd.OpenReport " rptFour", acViewNormal
DoCmd.Close acReport, " rptFour", acSaveNo
Set NewPrinter3 = Application.Printers(defPrinter)
Set Application.Printer = NewPrinter3
End Sub