标题: Do Your Forms Which Have Filter Options Take "Forever" to Close? [打印本页] 作者: tmtony 时间: 2005-8-17 18:51 标题: Do Your Forms Which Have Filter Options Take "Forever" to Close? 标题o Your Forms Which Have Filter Options Take "Forever" to Close? .
Access 97 introduced many new features including the option to filter by form which has carried forward into Access 2000, 2002 and beyond. Many developers also add options and methods to set filters on a form to search for or limit the form's records to a selected set.
In Access 97 and later, forms contain a property called "Filter" and "Filter On" (which applies the filter), which is set each time you set a filter on the form. The problem is that when you close the form with a filter remaining set on the form, that filter is set as the form's "Filter" property, and Access, sensing the form has changed from when it was first opened, saves the form on closing it, which appears to the user to slow down performance.
To rectify this problem is fairly simple since most developer's add a "Close" or "Exit" button to their form. In the code which you use in the event procedure for this button, make sure that you include the "SaveNo" option to the close command as in:
DoCmd.Close acForm, Me.Name, acSaveNo
Your form will close much faster and preserve the feel of fast performance.
Note: If you are using the control wizards in Access 97 to add the proper code to your command buttons you may need to change the code. Many of Access 97's control wizards place old style Access 2 and 95 "DoCmd.DoMenuItem" code in your event procedures (as witnessed by the A_MENU_VER70 tag,) and this can be updated to the code above. 作者: 爱情插班生 时间: 2005-8-19 23:25 标题: 您的窗体经过筛选关闭后,是不是在其筛选属性上永远残留其筛选条件呢? 标题:您的窗体经过筛选关闭后,是不是在其筛选属性上永远残留其筛选条件呢?