Filter problems

Filter problems

Post by Sven Stevenso » Mon, 22 Apr 2002 00:26:45



Thanks for taking a moment to look over my problem. It looks like an easy
one, so I'm confident somebody will have some advice. Basically, I am using
a quick and easy server filter to restrict data output on some of my forms.
I open a form using the following method to display only the record I want
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 it
will only bring up the ID number of the product at the time it was saved.
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 and
the Server Filter property of the database is saved with 'Criteria = 3548'.

My problem comes in removing the filter and saving the "blank" version of
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 appreciated.
Thanks in advance for your help.

Regards,

Alex

 
 
 

Filter problems

Post by User » Mon, 22 Apr 2002 02:16:14


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 the
ServerFilter property afterwards
ie:  set frm = openform( ...)
    frm.ServerFilter  = ...

I believe there is also a ServerFilteryOn (or something like that) property.
Look into that


Quote:> Thanks for taking a moment to look over my problem. It looks like an easy
> one, so I'm confident somebody will have some advice. Basically, I am
using
> a quick and easy server filter to restrict data output on some of my
forms.
> I open a form using the following method to display only the record I want
> 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 it
> will only bring up the ID number of the product at the time it was saved.
> 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 and
> the Server Filter property of the database is saved with 'Criteria =
3548'.

> My problem comes in removing the filter and saving the "blank" version of
> 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
appreciated.
> Thanks in advance for your help.

> Regards,

> Alex


 
 
 

Filter problems

Post by RJE » Tue, 23 Apr 2002 23:11:08


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).

Jay


> 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
the
> ServerFilter property afterwards
> ie:  set frm = openform( ...)
>     frm.ServerFilter  = ...

> I believe there is also a ServerFilteryOn (or something like that)
property.
> Look into that



> > Thanks for taking a moment to look over my problem. It looks like an
easy
> > one, so I'm confident somebody will have some advice. Basically, I am
> using
> > a quick and easy server filter to restrict data output on some of my
> forms.
> > I open a form using the following method to display only the record I
want
> > 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
it
> > will only bring up the ID number of the product at the time it was
saved.
> > 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
and
> > the Server Filter property of the database is saved with 'Criteria =
> 3548'.

> > My problem comes in removing the filter and saving the "blank" version
of
> > 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
> appreciated.
> > Thanks in advance for your help.

> > Regards,

> > Alex

 
 
 

1. Filter Problem in 7.0

I am having a problem with SQL 7 that does not occur in 6.5.   When I filter
on:

Field = '001'   The result is returned instantly

Field = '005'   The result is returned instantly

Field = '001' or Field = '005'  The result takes 20 seconds

Anyone seen this?

Thx
Rob

2. help: Can mySQL Server store Chinese Character?

3. Filter problem on recordset

4. Response File Mode Installation Question.

5. Acess 2000 .adp + SQL Server 7 filter problem

6. DaoRecord->MoveNext doesn′t work

7. SQL/Access2K Filtering problems

8. Dimension Source Table Filter problem

9. Replication filter problem

10. SQLCE Replication filtering problems

11. sql 7.0 and access 2000 and filter problem

12. date filtering problem