FilterOn Property
Applies to
Form Object |
Report Object |
You can use the FilterOn property to specify or determine whether the Filter property for a form or report is applied. Read/write Boolean.
expression.FilterOn
expression Required. An expression that returns one of the objects in the Applies To list.
Remarks
If you have specified a server filter within a Microsoft Access project (.adp), use the ServerFilterByForm property.
The FilterOn property uses the following settings.
Setting | Visual Basic | Description |
Yes | True | The object's Filter property is applied. |
No | False | (Default) The object's Filter property isn't applied. |
Note: For reports, you can set the FilterOn property by using the report's property sheet or Visual Basic for Applications (VBA) code.
For forms, you can set the FilterOn property in a macro or by using VBA code. You can also set this property by clicking Toggle Filter under Sort & Filter on the Data tab.
To apply a saved filter, press the Toggle Filter button for forms, or apply the filter by using a macro or Visual Basic by setting the FilterOn property to True for forms or reports. For reports, you can set the FilterOn property to Yes in the report's property sheet.
The Toggle Filter button indicates the state of the Filter and FilterOn properties. The button remains disabled until there is a filter to apply. If an existing filter is currently applied, the Toggle Filter button appears pressed in. To apply a filter automatically when a form or report is opened, specify in the OnOpen event property setting of the form either a macro that uses the ApplyFilter action or an event procedure that uses the ApplyFilter method of the DoCmd object.
You can remove a filter by clicking the pressed-in Toggle Filter button under Sort & Filter on the Data tab, or by using VBA code to set the FilterOn property to False. For reports, you can remove a filter by setting the FilterOn property to No in the report's property sheet.
Note: When a new object is created, it inherits the RecordSource, Filter, ServerFilter. OrderBy, and OrderByOn properties of the table or query it was created from. For forms and reports, inherited filters aren't automatically applied when an object is opened.
No comments:
Post a Comment