Microsoft KB Archive/293625

= ACC2002: Unable to Cancel Apply Server Filter in an Access Project =

Article ID: 293625

Article Last Modified on 11/5/2003

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q293625



Advanced: Requires expert coding, interoperability, and multiuser skills.

This article applies only to a Microsoft Access project (.adp).



SYMPTOMS
When you apply a server filter to a form in an Access project (.adp), setting the Cancel argument of the ApplyFilter event procedure to True does not stop the filter from being applied. Consequently, the form's recordset is filtered.



CAUSE
The Cancel argument of the ApplyFilter event procedure is ignored when you apply a server filter.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
Setting the Cancel argument to True usually cancels the event and places the database in a state that existed before the event was called. However, the Cancel flag is ignored if the form's ServerFilter property is set to Yes.

Steps to Reproduce the Behavior
 Open the sample Access project NorthwindCS.adp. Open the Products form in Design view. Set the ServerFilterByForm property of the Products form to Yes.  Set the OnApplyFilter property of the Products form to the following event procedure: Sub Form_ApplyFilter(Cancel as Integer, ApplyType as Integer)

Select Case ApplyType Case 0 MsgBox &quot;acShowAllRecords&quot; Case 1 MsgBox &quot;acApplyFilter&quot; Case 2 MsgBox &quot;acCloseFilterWindow&quot; Case 3 MsgBox &quot;acApplyServerFilter&quot; Cancel = True Case 4 MsgBox &quot;acCloseServerFilterWindow&quot; End Select

End Sub  Open the Products form in Form view.</li> In the Product Name text box, type Like 'S%' </li> Click Apply Server Filter on the toolbar.

A message box appears with the message &quot;acApplyServerFilter,&quot; indicating that the event has occurred. Note how the form is still filtered; the form should be back to the server filter in Form view.</li></ol>

Additional query words: pra

Keywords: kbbug KB293625

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.