D
DS
I'm trying set the printer according to the value in a textbox.
TxtPrint is the TextBox.
Is this the way to do it?
Thanks
DS
Private Sub PrintCatalogReport()
Dim rpt As Report
Application.Printer = Application.Printers(Me.TxtPrint)
DoCmd.OpenReport "Catalog", acViewPreview, , , acHidden
Set rpt = Reports!Catalog
With rpt.Printer
.BottomMargin = 720
.Copies = 2
.Duplex = acPRDPVertical 'Double sided
.PaperBin = acPRBNLargeCapacity
End With
DoCmd.OpenReport "Catalog", acViewNormal
DoCmd.Close acReport, "Catalog", acSaveNo
Set Application.Printer = Nothing
End Sub
TxtPrint is the TextBox.
Is this the way to do it?
Thanks
DS
Private Sub PrintCatalogReport()
Dim rpt As Report
Application.Printer = Application.Printers(Me.TxtPrint)
DoCmd.OpenReport "Catalog", acViewPreview, , , acHidden
Set rpt = Reports!Catalog
With rpt.Printer
.BottomMargin = 720
.Copies = 2
.Duplex = acPRDPVertical 'Double sided
.PaperBin = acPRBNLargeCapacity
End With
DoCmd.OpenReport "Catalog", acViewNormal
DoCmd.Close acReport, "Catalog", acSaveNo
Set Application.Printer = Nothing
End Sub