nam0812
New member
- Local time
- Tomorrow, 04:19
- Joined
- Mar 12, 2020
- Messages
- 5
Hello
my application access has a report name "RpKQNS"
In a form i made a combobox "CboPrinters" to change printer for report "RpKQNS"
but it can't be saved. There are no change in "The printer for that report"
Anyone has idea
Thanks in advance
Here the vba code
my application access has a report name "RpKQNS"
In a form i made a combobox "CboPrinters" to change printer for report "RpKQNS"
but it can't be saved. There are no change in "The printer for that report"
Anyone has idea
Thanks in advance
Here the vba code
Code:
Private Sub FillPrinterList(ctl As Control)
Dim prt As Printer
ctl.RowSourceType = "Value List"
For Each prt In Application.Printers
ctl.AddItem prt.DeviceName
Next prt
End Sub
Code:
Private Sub Form_Load()
Call FillPrinterList(Me.CboPrinters)
On Error Resume Next
Me.CboPrinters = Application.Printer.DeviceName
End Sub
Code:
Private Sub CboPrinters_AfterUpdate()
Dim prts As String
prts = Me.CboPrinters.Value
DoCmd.OpenReport "RpKQNS", acViewDesign, , , acHidden
Set Reports(RpKQNS).Printer = Application.Printers(prts)
DoCmd.Close acReport, "RpKQNS", acSaveYes
End Sub
Last edited: