title: How to pass reference to combobox?
body: <p>This is a continuation from a previous post of mine: <a href="https://stackoverflow.com/questions/38311039/how-to-select-a-printer-for-entire-job">How to select a printer for entire job?</a>, where I basically want to print a series of reports from a form in my Access database.</p>
  
  <p>Which refers to this help doc: <a href="https://msdn.microsoft.com/en-us/library/ee336132(v=office.12).aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/ee336132(v=office.12).aspx</a></p>
  
  <p>I'm trying to create the combobox with active printers in it in order to temporarily change the default printer for a series of documents. I'm tripped up on where it says "pass a reference to a ComboBox control"... How does one implement this?</p>
  
  <p>Here's the code I have so far, where <code>cboPrinterSelect</code> is the combobox name:</p>
  
  <pre><code>Private Sub cboPrinterSelect_Load(Cancel As Integer)
      Call GetPrinterList
      ' I'm not sure about this next part either'
      cboPrinterSelect.Value = GetPrinterList.value
  End Sub
  
  '***************************************************
  Private Sub cboPrinterSelect_AfterUpdate(Cancel As Integer)
      Set Application.Printer = Application.Printers(cboPrinterSelect.ListIndex)
  End Sub
  '***************************************************
  
  Private Sub GetPrinterList(ctl As Control)
      Dim prt As Printer
      For Each prt In Printers
          ctl.AddItem prt.DeviceName
      Next prt
      ctl = Application.Printer.DeviceName    
  End Sub
  </code></pre>
  
  <p>Any help/advice would be appreciated.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Here is my updated code, which is still throwing an error (described in Andre's comments):</p>
  
  <pre><code>Private Sub Form_Load()
      Call GetPrinterList(Me.cboPrinterSelect)
  End Sub
  
  '*********************************************************
  
  Private Sub cboPrinterSelect_AfterUpdate(Cancel As Integer)
  
  Set Application.Printer = Application.Printers(cboPrinterSelect.ListIndex)
  
  End Sub
  
  '***************************************************************
  
  Private Sub GetPrinterList(ctl As Control)
  
  Dim prt As Printer
  For Each prt In Printers
      ctl.AddItem prt.DeviceName
  Next prt
  ctl = Application.Printer.DeviceName
  
  End Sub
  </code></pre>