title: Apply Filter and OrderBy on Access Form Simultaneously
body: <h3>Background</h3>
  <p>I am looking for a way to improve speed / performance of an Access 2007 form. Users have two different views of the data, each with different filtering and sorting criteria. I have a checkbox that toggles this option and have the code to handle the toggle event:</p>
  <pre><code>Private Sub FilterOpenJobs_Click()
      If (FilterOpenJobs.Value) Then
          Me.Filter = &quot;Status='Open'&quot;
          Me.OrderBy = &quot;EndDate&quot;
          Me.FilterOn = True
          Me.OrderByOn = True
      Else
          Me.Filter = &quot;&quot;
          Me.OrderBy = &quot;JOB_NO&quot;
          Me.FilterOn = False
          Me.OrderByOn = False
      End If
  End Sub
  </code></pre>
  <p>The problem I have is that the form recordsource is fairly large, and applying the filters and sorts take some time. (Also note that the records come from mixed sources: some Access tables, some dBase tables.) It runs slowly enough that I am able to see the intermediate results between the <code>FilterOn</code> call and the <code>OrderByOn</code> call.</p>
  <h3>Questions</h3>
  <p>Is there anyway to apply a filter and sort simultaneously? Is there some way to lock the form from updating so that both can happen at once? Am I better off assigning a new value to the form <code>RecordSource</code> property? Would the form run faster if the filtering and ordering was done in the row source SQL?</p>