Filters won't turn off.

  • Thread starter Thread starter Al Camp
  • Start date Start date
A

Al Camp

What would cause a form filter to do the following...

While in any form, the user (of multiple users) places the cursor in a text
field (say... a City field with "Boston" for a value), and then right clicks
to get the shortcut menu. Then the user selects Filter By Selection, and
the form filters properly.
However, if the user then closes the form, and then reopens it, the City =
"Boston" filter is still applied.

Is anyone aware of what might cause this problem?

How might I make sure with code (upon closing the form) that the Filter
property is removed.

Thanks in advance,
Al Camp
 
Al,

The only way I can think of that would cause this is if the save option is
being included in the close method for the form. If that is not the case,
then you could turn the filter off just before you close the form.
 
Klatu,
Thanks for that info. I'll investigate that further.
In regards to removing a Filter...
What would be the syntax to clear the Filter property? I haven't had any
luck with "" or Null.
Thanks for your assistance,
Al Camp
 
Al,

I did a little testing, because this seems strange. Here is the code from
my testing, and I had no problems with it at all. I first tried setting a
filter on open, changing it, and looking at the result on reopen. The filter
was as I set it in on open. I then tried not setting a filter on open and
setting the filter with code and closing it with acSaveYes. On reopen, there
was no filter set. Everything seems to work as it should. Notice in the
code below, that Me.Filter = "" seems to be no problem. In short, I could
not recreate your problem.

Private Sub cmdExit_Click()
' Me.FilterOn = False
Me.Filter = ""
DoCmd.Close acForm, "frmXtest", acSaveYes
End Sub

Private Sub cmdFilter_Click()
Dim strFilter As String
Me.FilterOn = False
strFilter = InputBox("Enter Filter")
If strFilter = "" Then
Me.Filter = ""
Else
Me.Filter = "BillCat = '" & strFilter & "'"
Me.FilterOn = True
End If
End Sub

Private Sub Form_Open(Cancel As Integer)
Me.Filter = "BillCat = 'SEL'"
Me.FilterOn = True
End Sub
 
Klatuu,
Thanks for hangin' in there on this weird problem
Here's what I wrote back to the user after I investigated...
----------
Took a look at that problem with filter retention...
I couldn't duplicate your problem, but there certainly seems to be some
inconsistencies in the way Access controls that Filter property.

I was able to get a filter to "stick" a few times... meaning that when I
reopened the form, the Filter property still showed a filter value... BUT...
the filter did not apply itself. It was just there in the property box.
And now, I can't seem to get that filter to "stick" anymore... at all...
try as I might.
I saw it do it a few times, and now I can't duplicate it again. Very
flaky!

For now though, I'd just try a FilterOn = False using the OnOpen event
of the form. That should stop/mask the problem.
The logic being... we don't care if there is a filter in the Filter
property when we open a form, just as long as it doesn't "apply itself"!
And, if we do subsequent form filtering, we'll just "cover over" that
value with a new one anyway...
-----------

I think I'm just going to leave it at that for now. (By the by... it's
not an app I developed, just an old client with a question about another
Access app he uses.)
Personally I think it may be due to some "multi-user" configuration,
whicj I can not duplicate here. Maybe an .ldb thing?

I appreciate your help very much. See you on the NGs...

Thanks,
Al Camp

PS: No disprespect meant, but your name reminds of the famous line from
the movie "The Day the Earth Stood Still" when
Michael Rennie commands his robot to guard the ship...
Gort! Klaatu barada nikto!
(it's a classic piece of movie "trivia")
Any connection?
 
That is where the name came from :) It is one of the all time great Sci Fi
movies. I saw it as a kid when it came out and have seen it many times.
Actually, Klatuu is the name of the Michael Rennie character. That famous
line was not delivered by Michael Rennie, but by the kid of the woman he is
staying with. The message means Klatuu says come now in a hurry (as I recall)

The multi user idea is not impossible if multiple users are using the same
mdb which, I know you know, is always a bad idea. I am in the frustrating
position now with users who have one FE on the same server as the BE and all
users use the same FE. Regardless of how many times I have tried to explain
the problems here, all I get is Access is not dependable because it keeps
getting corrupted and it is too slow. (duh) And when the App craps in it's
pants, of course it is my fault. The most recent change I made must have
caused the problem. (I am about ready to zap them with my death ray)
 
Yes, you're right... Rennie (I think the spelling is "Klaatu" according
to the IMDB) didn't say it to the robot. He told the kid to say that to the
robot if he (Klaatu) is injured or killed.
I think it means "I've got that ten bucks I owe you!" :-D
A great flick, with that wonderful Theremin "alien sound" in the
background, and also featuring Frances Bavier (Mayberry's Aunt Bea)!
My all time favorite is Forbidden Planet which introduced Robby the Robot
for the first time. As a kid, I couldn't get enough of those SciFi flicks!
Later...
Al Camp
 
Your spelling is corret. I got an incorrect spelling a long time ago, and
since it is my screen name for almost everything, it is too much trouble to
change. Also, I remembered incorrectly. It is actually Helen, the woman he
stayed with that delivers the message. Here is directly from the script:

TWO SHOT - HELEN AND GORT

as the great robot bends over her menacingly, arms
outstretched as though to grab or smash her.

CLOSE SHOT - HELEN

All hope gone, she is blessed with a moment of lucidity, and
she remembers the message Klaatu told her to deliver.

HELEN
Gort--!
(with desperate clarity)
Klaatu -- barada -- nikto.

CLOSE SHOT - GORT

He pauses as he hears the words. His face doesn't change
expression, but the words obviously have an effect on him.
He hesitates thoughtfully for a moment.

TWO SHOT - HELEN AND GORT

Helen watches him in an agony of suspense. Then the robot
slowly bends down, picks her up in his arms and starts walking
toward the space ship.

There is some debate over what it meant. Maybe it meant "Hey, big guy, want
a date?"
:)
 
Back
Top