title: Microsoft Access - combo box dropdown errors
body: <p>I am new to VBA/Access so I have been using queries/VBA code I find online to help me build my current form. I experiencing weird behavior with my combo box and i think it may be due to the VBA/queries I have attached to it. </p>
  
  <p>The code below is used to make the combo box a dynamic search tool: as you type each letter, it reruns the query to update the list with only the last names that match the letters typed. </p>
  
  <p>However, pressing the arrow keys/tab/enter does nothing. The only way to navigate/select a value in the dropdown is a mouse click. And when I click the value I want, the form populates the data from the that record (yay!) but the dropdown menu stays visible until i click the background of the form. </p>
  
  <p>I want the dropdown to disappear as soon as I select the record I want, and if possible I want to be able to use the arrow keys to navigate.  </p>
  
  <p>The "On Change" event has this code:</p>
  
  <pre><code>Private Sub Combo1397_Change()
  
  Dim strText, strFind
  Combo1397.SetFocus
  
  strText = Me.Combo1397.Text
  
  If Len(Trim(strText)) &gt; 0 Then
  
  strFind = "[Last Name] Like '"
  For i = 1 To Len(Trim(strText))
      If (Right(strFind, 1) = "*") Then
          ' When adding another character, remove the
          ' previous "*," otherwise you end up with
          ' "*g**w*" instead of "*g*w*."
          ' This has no apparent impact on the user, but
          ' ensures that the SQL looks as intended.
          strFind = Left(strFind, Len(strFind) - 1)
      End If
      strFind = strFind &amp; "*" &amp; Mid(strText, i, 1) &amp; "*"
  Next
  strFind = strFind &amp; "'"  
  
  
  strSQL = "SELECT tbl_RC_Main.pk_CandidateID, tbl_RC_Main.[Last Name],tbl_RC_Main.[First Name], tbl_RC_Main.Email FROM tbl_RC_Main Where " &amp; _
  strFind &amp; " ORDER BY [Last Name];"
  
  
  Me.Combo1397.RowSource = strSQL
  
  Else
      ' Show the entire list.
      strSQL = "SELECT tbl_RC_Main.pk_CandidateID, tbl_RC_Main.[Last Name],tbl_RC_Main.[First Name], tbl_RC_Main.Email FROM tbl_RC_Main ORDER BY tbl_RC_Main.[Last Name]; "
      Me.Combo1397.RowSource = strSQL
  End If
  
  Me.Combo1397.Dropdown
  End Sub
  </code></pre>
  
  <p>Also,
  On the "After Update" event I have a "Search for Record" macro </p>