窗体筛选属性 (权限)Form.FilterOn property (Access)

可以使用将 FilterOn 属性可以指定或确定是否已应用的 筛选器 属性的窗体或报表。You can use the FilterOn property to specify or determine whether the Filter property for a form or report is applied. 读/写 BooleanRead/write Boolean.

语法Syntax

表达式开启筛选expression.FilterOn

expression:表示 Form 对象的变量。expression A variable that represents a Form object.

说明Remarks

如果您想要指定 Microsoft Access 项目 (.adp) 中的服务器筛选数据的服务器上,使用 服务器过滤器 属性。If you want to specify a server filter within a Microsoft Access project (.adp) for data located on a server, use the ServerFilter property.

若要应用保存的筛选器,请按 应用筛选 按钮的窗体,或应用筛选器通过使用宏或 Visual Basic 窗体或报表中将 FilterOn 属性设置为 TrueTo apply a saved filter, press the Apply 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. 对于报表,可以将 FilterOn 属性设置为是中报表的属性表。For reports, you can set the FilterOn property to Yes in the report's property sheet.

应用筛选 按钮指示 筛选器筛选 属性的状态。The Apply 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 Apply Filter button appears pressed in. 打开窗体或报表时自动应用筛选器,请在该窗体,或者可以使用 ApplyFilter 操作的宏或事件过程,可以使用 ApplyFilter DoCmd 对象的方法的 OnOpen 事件属性设置中指定。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.

您可以通过选择 "按下" "应用筛选" 按钮、选择 "记录" 菜单上的 "取消筛选/排序" 或使用 Visual Basic 将 "开启筛选" 属性设置为False来删除筛选。You can remove a filter by choosing the pressed-in Apply Filter button, choosing Remove Filter/Sort on the Records menu, or using Visual Basic to set the FilterOn property to False. 对于报表,可以通过将 FilterOn 属性设置为否中报表的属性表中删除筛选器。For reports, you can remove a filter by setting the FilterOn property to No in the report's property sheet.

备注

创建新对象时, 它会继承创建它的表或查询的RecordSourceFilterServerFilterOrderByOrderByOn属性。When a new object is created, it inherits the RecordSource, Filter, ServerFilter, OrderBy, and OrderByOn properties of the table or query that it was created from. 对于窗体和报表,其继承的筛选在打开对象时并不会自动应用。For forms and reports, inherited filters aren't automatically applied when an object is opened.

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.