title: Requery only one record in a datasheet view form (MS Access)
body: <p>I have a rather simple looking problem but it turned out to be more complicated than I thought.</p>
  
  <p>I have a field (column) in my subForm which is a ComboBox.
  I have a field (column) in another subForm by which I would like to filter this comboBox.</p>
  
  <p>Basically, the comboBox before filtering has some 600 records, too many to scroll by casual user. I created a simple subForm whose field is linked to a mainForm and this works perfectly (ie. the selected record-field-ID is displayed on mainForm).</p>
  
  <p>Now what I want is that this comboBox is filtered by this record (ie. only showing relevant fields). The problem is that if I simply Requery it with this given filter, the other fields show up blank.</p>
  
  <p>I want this filter to apply only to NEW RECORDS comboBox, not the whole datasheet view.</p>
  
  <p>What I did is:</p>
  
  <pre><code>Private Sub Sekacie_Operacie_GotFocus()
  Dim SQL As String
      SQL = CurrentDb.QueryDefs("qrySekacie_Operacie").SQL
      Me.Sekacie_Operacie.RowSource = Replace(SQL, ";", "") &amp; " WHERE Sekacie_Operacie.Operacia_ID = " &amp; Me.Parent.Form!txtOP_ID
      Me.Sekacie_Operacie.Requery
  'works kinda as intended
  End Sub
  
  Private Sub Form_AfterInsert()
      Me.Sekacie_Operacie.RowSource = CurrentDb.QueryDefs("qrySekacie_Operacie").SQL
      Me.Refresh
  End Sub
  </code></pre>
  
  <p>And when I select the record in my filter subForm:</p>
  
  <pre><code>Private Sub Form_Current()
  Dim SQL As String
      SQL = CurrentDb.QueryDefs("qrySekacie_Operacie").SQL
  With Me.Parent.Form.subSekacie_Operacie_Modelu
      .Form!Sekacie_Operacie.RowSource = SQL
      .Form.Refresh
  End With
  End Sub
  </code></pre>
  
  <p>However, this workaround still shows "blank" records sometimes (I have to refresh the form by clicking different record) and I find it strange I had to go all the way to do this. Is there no simpler way of accomplishing this?</p>