|
标题o Your Forms Which Have Filter Options Take "Forever" to Close? .
原作者:ATTAC Consulting Group
原文网址:http://ourworld.compuserve.com/homepages/attac-cg/AFormTip.htm#KEY
摘抄人:tmtony
翻译人:
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. |
|