ACC: Cannot Completely Remove Form FilterID: Q172284
|
Novice: Requires knowledge of the user interface on single-user computers.
When you apply a filter or sort to a form and then click Remove Filter/Sort
on the Records menu, it appears that the filter or sort has been removed.
However, if you check the Filter property and OrderBy property in a Visual
Basic for Applications procedure or in the form's property sheet, you see
that these properties contain the values that were in effect before you
removed the filter or sort.
The Apply Filter/Sort and Remove Filter/Sort commands on the Records menu change only the values of the FilterOn and OrderByOn properties. These commands do not affect the values of the forms's Filter or OrderBy properties. Selecting Remove Filter/Sort on the Records menu simply sets FilterOn and OrderbyOn to False. As a result, the form displays all of the records, because, although the filter or sort is still present, it is no longer in effect.
Use either of the following methods to completely remove a filter or sort from a form.
Private Sub Form_Current()
If Me.FilterOn = False Then
Me.Filter = ""
Me.OrderBy = ""
End If
End Sub
This behavior is by design.
Name: btnShowFilter
Caption: Show Filter
Private Sub btnShowFilter_Click()
MsgBox Me.Filter
End Sub
((Customers.Country = "Germany"))
((Customers.Country = "Germany"))
For more information, search the Help Index for "Filter property," "FilterOn property," "OrderBy property," and "OrderByOn property."
Additional query words: empty
Keywords : kbusage FmsProp
Version : WINDOWS:7.0,97
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: June 16, 1999