By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,790 Members | 1,398 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,790 IT Pros & Developers. It's quick & easy.

VBA filter code does not work!

P: n/a
Anyone have a clue about this:

Here's some form code:

Me.Filter = ""
Me.FilterOn = false

This code does NOT purge the filter criteria.

What's up? What am I missing?
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
> Me.Filter = ""

This will clear the filter criteria in the current session, but won't stick once
the form is closed. If you want to programmatically remove the filter
permanently, you will need to use VBA to open the form in design mode, set the
filter property and then save and close the form.
Me.FilterOn = false


This does not alter the form's "Filter" property. The FilterOn property merely
turns the filter on and off.

--
Bruce M. Thompson
bt******@mvps.org (See the Access FAQ at http://www.mvps.org/access)
NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<
Nov 12 '05 #2

P: n/a
Thanks Bruce.

On Tue, 7 Oct 2003 20:33:49 -0400, "Bruce M. Thompson"
<bthmpson@big_NOSPAM_foot.com> wrote:
Me.Filter = ""


This will clear the filter criteria in the current session, but won't stick once
the form is closed. If you want to programmatically remove the filter
permanently, you will need to use VBA to open the form in design mode, set the
filter property and then save and close the form.


I did NOT know this. This fact seems to mean that I should save the
form from design view with NO filter defined. Then when the form is
opened, no filter will be in place.
Me.FilterOn = false


This does not alter the form's "Filter" property. The FilterOn property merely
turns the filter on and off.


I knew this.
Nov 12 '05 #3

P: n/a
> >> Me.Filter = ""

This will clear the filter criteria in the current session, but won't stick oncethe form is closed. If you want to programmatically remove the filter
permanently, you will need to use VBA to open the form in design mode, set thefilter property and then save and close the form.


I did NOT know this. This fact seems to mean that I should save the
form from design view with NO filter defined. Then when the form is
opened, no filter will be in place.


That is correct.

:-)
--
Bruce M. Thompson
bt******@mvps.org (See the Access FAQ at http://www.mvps.org/access)
NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<
Nov 12 '05 #4

P: 3
Hi. I am trying to permanently clear the filter criteria from my form properties using the method that you described. However, I have tried several variations and am not having much luck. I am using the "learn as I go method"...so I am not an expert. Any help would be greatly appreciated! Thanks.
Jul 2 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.