There is no "ServerFilterOn" property in ADPs, and you definitely DON'T want
to open the form w/no filter, then "apply" one, as that defeats the purpose
of using an ADP (true client/server). You end up pulling the whole
recordset, the re-querying the back-end for the filtered sub-set.
Open the form with the "filter clause" argument to docmd.openform. The form
will open filtered (what you want) and the filter will be in the
"serverfilter" property. DON'T switch to design view! It's an Access
"feature" that if you do, the filter will be "saved" with the form (if the
form is saved when you close - which it most likely will be!). In your apps
normal flow, change filters by setting the new filter in the ServerFilter
property, then do "Me.Requery" to get the new set from the server. When you
close the form, make sure it's "clear" by setting Me.ServerFilter = "" (but
don't requery - since you're closing the form anyway).
> There are lots of problems with ServerFilter in Access 2K ADP's (dont know
> about 2002).
> Some of these are documented in knowledgebase articles.
> Some of these articles are also wrong.
> You might try opening the form without any filter and then with code set
> ServerFilter property afterwards
> ie: set frm = openform( ...)
> frm.ServerFilter = ...
> I believe there is also a ServerFilteryOn (or something like that)
> Look into that
> > Thanks for taking a moment to look over my problem. It looks like an
> > one, so I'm confident somebody will have some advice. Basically, I am
> > a quick and easy server filter to restrict data output on some of my
> > I open a form using the following method to display only the record I
> > shown:
> > Dim stOpenFiltered As String
> > stOpenFiltered = "[Criteria]=" & Me![txtCriteria]
> > DoCmd.OpenForm "frmName", , , stOpenFiltered
> > However, occasionally this information gets saved to the Server Filter
> > property of the form, which effectively renders it useless because now
> > will only bring up the ID number of the product at the time it was
> > Say the first time I open the form, I wanted to retrieve record 3548.
> > Everytime after that, when I open the form, it will only display 3548
> > the Server Filter property of the database is saved with 'Criteria =
> > My problem comes in removing the filter and saving the "blank" version
> > the form when the user closes the form. My first thought was to use:
> > Me.ServerFilter = ""
> > DoCmd.Save
> > But that does nothing. Your thoughts and assistance are greatly
> > Thanks in advance for your help.
> > Regards,
> > Alex