Setting a Printer

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
 

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

Top