How to check if form view is filterbyform
<p>I am using two forms. The form this code is from shows a weekly summary of booked appointments: it contains text boxes that display a count of appointments for each team on each day, and daily and weekly totals. I have replaced the double click events for all the text boxes with a function. When a text box is double clicked another form is used to display records that are counted in that text box. It all works great unless the user already has the details form open and has selected the filter by form option but has not yet applied the filter.</p>

<p>I check to see if the details form is open, if not then I open it with an SQL sting to show the records for the counted appointments. If the details form is already open then I check to see if a filter is applied, remove it, then filter to show the records for the counted appointments.</p>

<pre><code>If CurrentProject.AllForms("MyForm").IsLoaded = False Then 
  DoCmd.OpenForm "MyForm", , mysql
Else
  If Forms("MyForm").FilterOn = True Then Forms("MyForm").FilterOn = False
  Forms("MyForm").Filter = myfil
  Forms("MyForm").FilterOn = True
End If
</code></pre>

<p>How can I check if the details form is in the filter by form view/state? and if it is, close it. So I can apply the filter to show the records of the counted appointments.</p>