Form.
You can use the AllowFilters property to specify whether records can be filtered.
The AllowFilters property uses the following settings.
Setting | Description | Visual Basic |
Yes | (Default) Records can be filtered. | True (-1) |
No | Records cant be filtered. | False (0) |
You can set this property using the forms property sheet, a macro, or Visual Basic.
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.
Filter Property, ShortcutMenu Property.
The following example shows a function that toggles a forms AllowFilters property on and off.
Function ToggleAllowFilters() As Integer Forms!Customers.AllowFilters = Not Forms!Customers.AllowFiltersFunction