title: Access 2013 - Textbox searching in two fields
body: <p>I have a simple database for tracking incidents at work.  On the main form is a subform that shows a brief overview of all events logged.  </p>
  
  <p>I have a search box in the subform's header that searches keywords in the "Details" field, but I would like it to also search in the "Location" field of the subform at the same time.  </p>
  
  <p>My code is:</p>
  
  <pre><code>Private Sub Text18_Change()
  Dim strFilter As String
  
  Me.Refresh
  
  strFilter = "Details like '*" &amp; Me.Text18 &amp; "*'"
  
  Forms![Main Form]![MainIncidentList].Form.Filter = strFilter
  Forms![Main Form]![MainIncidentList].Form.FilterOn = True
  
  Me.Text18.SelStart = Nz(Len(Me.Text18), 0)
  End Sub
  </code></pre>
  
  <p>I'm relatively new at Access and VBA but I've gotten this far, can anyone give me some advice on how to add the "Location" field to the search?  I've tried adding </p>
  
  <pre><code>" And "Location like '*" &amp; "Me.Text18 &amp; "*'"
  </code></pre>
  
  <p>at the end of the "strFilter" line, but it did not work, Access gives a syntax error.</p>
  
  <p>Both "Details" and "Location" are defined as "long text" in the table.</p>
  
  <p>Thanks in advance.</p>