title: ms access combobox does not autofill
body: <p>MS Access 2010</p>
  
  <p>I have a form that provides a text value to a combobox on another form but the combobox autofill does not respond to the text data that is provided by the OnClick event.  I receive an error 2237 the data is not in the list.  I need this to work as some of the comboboxes have thousands of records and schrolling this list is therefore not practical. Here is the code that inserts the text in the combobox:</p>
  
  <pre><code>Private Sub tOK_Click()
  Dim p As String
  Dim f As String
  Dim c As String
  Dim txtResult As String
  Dim pFrmName As String
  Dim frmName As String
  Dim ctrl As String
  
  On Error GoTo errHandler
  pFrmName = Me.pFrmName
  frmName = Me.frmName
  ctrl = Me.ctrlName
  p = pFrmName
  f = frmName
  c = ctrl
  
  If p = c Then
      Forms(f).SetFocus
      Forms(f)(c).Text = Me.txtResult
  Else
       Forms(f)(p)(c).SetFocus
       Forms(f)(p)(c).Text = Me.txtResult
  
  End If 
  </code></pre>