title: How to Requery a subform inside a form?
body: <p>I'm having a problem in which I can't requery a subform inside of a form in Access.</p>
  
  <p>The form's name is frmSearch
  The subform's name is SearchResults</p>
  
  <p>I've tried</p>
  
  <pre><code>Private Sub Command38_Click()
  
  Me!SearchResults.Form.Requery (or)
  Me.SearchResults.Form.Requery
  
  End Sub
  </code></pre>
  
  <p>My form &amp; subform look like this:</p>
  
  <p><img src="https://i.stack.imgur.com/S6iyx.jpg" alt="enter image description here"></p>
  
  <p>To be clear, I'm using the "Search" button to create a string which contains the textbox and combobox values. This string creates a SQL query called qryTrialQuery. Then my subform makes a query of the qryTrialQuery and produces the results in the table bellow.</p>
  
  <p>I would like to be able to press the search button and then the results appear below it immediately after. The problem is, is that the results don't appear unless I close and reopen the form.</p>
  
  <p>Thanks for all your help in advance.</p>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>The following is the code I used to create a query from the textbox and combobox values.</p>
  
  <pre><code>LineOne = "SELECT tblPoolPersonnel.LName, tblPoolPersonnel.FName, tblPoolPersonnel.[Tel Natel], tblPoolPersonnel.[Tel Home], tblPoolPersonnel.Email" &amp; vbCrLf
  LineTwo = "FROM (tblPoolPersonnel INNER JOIN tblDayAvailable ON tblPoolPersonnel.Code_Personal = tblDayAvailable.Code_Personal) INNER JOIN tblServiceYES ON tblPoolPersonnel.Code_Personal = tblServiceYES.Code_Personal" &amp; vbCrLf
  LineThree = "WHERE (((tblServiceYES.Service)=" &amp; comboService &amp; ") AND ((tblDayAvailable.Availability)=True) AND ((tblDayAvailable.Date)=" &amp; txtDate &amp; ") AND ((tblDayAvailable.CodeHoraire1)=" &amp; comboCodeHoraire &amp; "));"
  
  Set qdf = CurrentDb.QueryDefs("myQuery")
  Application.RefreshDatabaseWindow
  strSQL = LineOne &amp; LineTwo &amp; LineThree
  qdf.SQL = strSQL
  qdf.Close
  Set qdf = Nothing
  Set dbs = Nothing
  </code></pre>