Help and Support

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

Article ID:283362
Last Review:August 10, 2004
Revision:3.1
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).

On This Page

SUMMARY

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.

Steps to Enable the ServerFilterByForm Property

1.Create an Access project (ADP), and connect to the Pubs database.
2.Create a new form that is based on the Authors table.
3.Create a command button with the following code snippet:
Me.ServerFilterByForm = True
Me.Refresh
DoCmd.RunCommand acCmdServerFilterByForm
					
4.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.
5.Before you start the application in a run-time environment, make sure that you set the Startup form.
6.Create a shortcut that starts the project, and include the /runtime switch in the command line, as follows:
"C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE" "C:\Program Files\Microsoft Office\Office10\Samples\Pubs.adp" /runtime
7.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.

Back to the top

REFERENCES

For more information about the ServerFilterByForm property, click Microsoft Access Help on the Help menu, type serverfilterbyform property in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Back to the top


APPLIES TO
Microsoft Access 2002 Standard Edition

Back to the top

Keywords: 
kbhowtomaster kbtoolbar kbdta KB283362

Back to the top

Article Translations

 

Related Support Centers

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.