title: How do I custom sort a query on a subform?
body: <p>I have a query that has a "Status" field name with possible entries of "Overdue", "Due Soon", "In-Progress" and "Complete". I can display the records in that order when opening the query using <code>IIF</code>, but cannot translate it over to the subform that displays the query. I'd like the query to be sorted upon <code>Form_Open()</code></p>
  
  <pre><code>Private Sub Form_Open(Cancel As Integer)
  
  Me.frm_Stability.Form.OrderBy = "Status ASC IIf([Status]='Overdue',1,IIf([Status]='Due Soon',2,IIf([Status]='In-Progress',3,IIf([Status]='Complete',4))))"
  Me.frm_Stability.Form.OrderByOn = True
  
  End Sub
  </code></pre>
  
  <p>Any help would be appreciated!</p>