AllowFilters Property

Applies To

Form.

Description

You can use the AllowFilters property to specify whether records can be filtered.

Settings

The AllowFilters property uses the following settings.

Setting Description Visual Basic
Yes (Default) Records can be filtered. True (-1)
No Records can’t be filtered. False (0)


You can set this property using the form’s property sheet, a macro, or Visual Basic.

Remarks

Filters are commonly used to view a temporary subset of the records in a database. When you use a filter, you apply criteria to display only records that meet specific conditions. In an Employees table, for example, you can use a filter to display only records of employees with over 5 years of service. You can also use a filter to restrict access to records containing sensitive information, such as financial or medical data.

When the AllowFilters property is set to No, all of the filter options on the Records menu and the shortcut menu are disabled.

See Also

Filter Property, ShortcutMenu Property.

Example

The following example shows a function that toggles a form’s AllowFilters property on and off.


Function ToggleAllowFilters() As Integer
    Forms!Customers.AllowFilters = Not Forms!Customers.AllowFiltersFunction