Docmd criteria vs. saved serverfilter

  • Thread starter Thread starter Vadim Rapp
  • Start date Start date
V

Vadim Rapp

Hello:

here's the problem with my ADP in Access 2002.

Form1 has a button that runs docmd.openform "Form2",,,<some criteria>

Access then opens Form2 with applied ServerFilter = <some criteria>

Once Form2 is open, the user sorts the records by one of the columns.

When he does that, Access automatically resaves the form along with the "order
by" property, but as well with the current ServerFilter=<some criteria>

Then the user closes the form.

Next time when he opens Form2 from Form1 with different criteria, the criteria
does not work according to Q296049, because the saved Form2 now has non-empty
ServerFilter, which overrides docmd.

I probably can come up with some walkaround, for instance closing form2 only
programmatically with forced reset of serverfilter and orderby and resaving;
however, this all is so inconvenient; and at the same time, this problem
apparently affects very generic scenario (whenever the user sorts the records
in a form opened by docmd.openform), so I hesitate, maybe there's something I'm
missing in this picture?

One more amazing thing is that Access resaves the form with the filter etc.
even if it's Access Runtime-only. Something I asume it shouldn't do.

Does anyone has an idea how to avoid autosaving the form by Access when the
data is sorted? According to Q207769, the sort order is indeed saved along with
the form; however, the article does not say that the form is autosaved once the
sort order is applied.


thanks,

Vadim
 
I was dealing with Filter being saved.
I since I wanted to protect form a form not be closed normally.
I use form load to reset the Filter =.
I assume you can do a Server Filter """ on the form load.
 
Back
Top