title: Access: converting form result to table
body: <p>I created a basic search form which has input fields, buttons and area where it displays result.</p>
  
  <p>keyword is entered to input fields, and click "search" button to display results.</p>
  
  <p>the search button has the following code:</p>
  
  <pre><code>Private Sub mySearchQuery_Click()
  Dim strSelect As String
  Dim strWhere As String
  
  If Len(Trim(Me!searchFirst.Value) &amp; vbNullString) &gt; 0 Then
      strWhere = strWhere &amp; " AND First_Name Like ""*" &amp; Me!searchFirst.Value &amp; "*"""
  End If 
  If Len(Trim(Me!searchLast.Value) &amp; vbNullString) &gt; 0 Then
      strWhere = strWhere &amp; " AND Last_Name Like ""*" &amp; Me!searchLast.Value &amp; "*"""
  End If
  If Len(Trim(Me!searchState.Value) &amp; vbNullString) &gt; 0 Then
      strWhere = strWhere &amp; " AND State Like ""*" &amp; Me!searchState.Value &amp; "*"""
  End If
  If Len(Trim(Me!searchLIC.Value) &amp; vbNullString) &gt; 0 Then
      strWhere = strWhere &amp; " AND LIC Like ""*" &amp; Me!searchLIC.Value &amp; "*"""
  End If
  If Len(Trim(Me!searchNPN.Value) &amp; vbNullString) &gt; 0 Then
      strWhere = strWhere &amp; " AND NPN Like ""*" &amp; Me!searchNPN.Value &amp; "*"""
  End If
  If Len(Trim(Me!searchEmail.Value) &amp; vbNullString) &gt; 0 Then
      strWhere = strWhere &amp; " AND Email Like ""*" &amp; Me!searchEmail.Value &amp; "*"""
  End If
  If Len(Trim(Me!searchDateFrom.Value) &amp; vbNullString) &gt; 0 Then
      strWhere = strWhere &amp; " AND EXP &gt;= #" &amp; Me.searchDateFrom.Value &amp; "#"
  End If
  If Len(Trim(Me!searchDateTo.Value) &amp; vbNullString) &gt; 0 Then
      strWhere = strWhere &amp; " AND EXP &lt;= #" &amp; Me.searchDateTo.Value &amp; "#"
  End If  
  
  strSelect = "SELECT * FROM MasterData"
  If Len(strWhere) &gt; 0 Then
  strSelect = strSelect &amp; " WHERE " &amp; Mid(strWhere, 6)
  End If
  
  Me.RecordSource = strSelect
  ' SubForm.Form.RecordSource = sql
  End Sub
  </code></pre>
  
  <p>This search button would search item based on given criteria.  If I input "NY" in State input field and press Search button, it would show result that state is set to NY.</p>
  
  <p>My question is: how do i export this returned result from form to table and save it? it would be nice if i can do that. </p>