Microsoft KB Archive/283362

= How to set the ServerFilterByForm property in a run-time application in Access 2002 =

Article ID: 283362

Article Last Modified on 8/10/2004

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q283362





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

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



IN THIS TASK
SUMMARY
 * Steps to Enable the ServerFilterByForm Property

REFERENCES To enable the ServerFilterByForm property in an Access 2002 run-time environment, you must use the following code snippet. Me.ServerFilterByForm = True Me.Refresh DoCmd.RunCommand acCmdServerFilterByForm You do not have to have a toolbar with the ServerFilterByForm button on the form in the run-time application.

back to the top

Steps to Enable the ServerFilterByForm Property
 Create an Access project (ADP), and connect to the Pubs database. Create a new form that is based on the Authors table.  Create a command button with the following code snippet: Me.ServerFilterByForm = True Me.Refresh DoCmd.RunCommand acCmdServerFilterByForm  Open the form in Form view, and then click the button.

NOTE: The form will still display all of the information for the Authors table, but the ServerFilterByForm button on the toolbar is now enabled. Before you start the application in a run-time environment, make sure that you set the Startup form. Create a shortcut that starts the project, and include the /runtime switch in the command line, as follows:

&quot;C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE&quot; &quot;C:\Program Files\Microsoft Office\Office10\Samples\Pubs.adp&quot; /runtime

</li> Test the database. If you only use DoCmd.RunCommand acCmdServerFilterByForm and do not set the property first, you will receive the following error message:

In the retail version of Access:

Run-time error '2046':

The command or action 'ServerFilterByForm' isn't available now.

In a run-time application:

Execution of this application has stopped due to a run-time error.

The application can't continue and will be shut down.

</li></ol>

back to the top

<div class="references_section">