Go to Top

Part 1 Access ADP Tip: Using ADP ServerFilter property

Note: This is part one of a series of articles on Access ADP projects.
Click to see Part 2
Click to see Part 3 

Where and Filter Clause do not work when using DoCmd.OpenForm Statement
One of the issues you will find when working with an Access Data Project, (ADP), is the lack of functionality in the Where and Filter clause of the DoCmd.OpenForm statement, they don’t work with ADPs. There are two techniques you can use to overcome this limitation:

MS Access Consulting

Set The Form’s Record Source Property
On startup or during the course of using the form, you can set the form’s record source property using the OpenArgs argument:
Me.RecordSource = “Select * from MyTable Where ” & Me.OpenArgs

Use ServerFilter Property
Another method is to use the ServerFilter property of the form. On the open event you will need to use the following statements
Me.ServerFilter = “”
Me.ServerFilter = Me.OpenArgs
The first line is needed to reset the property before you set it to something else.

About Juan Soto

Juan Soto is a Senior Access Developer at IT Impact Inc. and a Microsoft Access MVP. He specializes in Access with SQL Server databases. His passion for Access has led him to helping a wide range of businesses in helping them establish a secure, stable and efficient environment with SQL Server. He's a frequent speaker at Access user groups nationwide and recently spoke at the Orange County SQL Saturday # 73. If you wish to have Juan speak at your next group meeting you can contact him here.

2 Responses to "Part 1 Access ADP Tip: Using ADP ServerFilter property"

  • Heshie
    September 11, 2015 - 12:11 am Reply

    Thanks Juan Soto.

    We use an ADP Project and have found that although DoCmd.OpenForm did work, often the ServerFilter property would get stuck to the last filter.

    Using OpenArgs appears to have solved this issue.

    • Juan Soto
      September 12, 2015 - 1:25 am Reply

      Glad to hear it worked!

      Please keep in mind ADP projects will no longer be available after Access 2007, are you planning to upgrade to Linked tables?

Leave a Reply

Your email address will not be published. Required fields are marked *


Contact Us
close slider
  • This field is for validation purposes and should be left unchanged.