Locking in Filters

In my databases I use filters.  Every time I open a database I have to click on the "unfiltered" option at the bottom of the screen to activate the filter.    Is it possible to lock in the filter so it is active when I open the database?
Richard WilliamsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jeffrey CoachmanMIS LiasonCommented:
Then simply use a form based on a query that does the filtering...

You did not give us any info on your "Filter", ...so try things like this:

SELECT f1, f2, f3
FROM YourTable
WHERE F2="Mike"

SELECT f1, f2, f3
FROM YourTable
WHERE F3=67

Then base the form on this query, ...then just open the form...
Filter will be applied automatically


JeffCoachman
0
Richard WilliamsAuthor Commented:
FYI, I have a library database with two tables.   First is a list of my books; second is my reading list.  I have a form with a subform that uses a filter to show only the books I am reading.  It works nicely but every time I open the file I have to click to activate the filter.  While not a big deal, I would prefer it to be locked.  I will play with your suggestion in creating a query and then a form.
0
Jeffrey CoachmanMIS LiasonCommented:
the the recordsource for the subform might be something like:
SELECT *
FROM tblReadingList
Where CurretlyReading=True

SELECT *
FROM tblReadingList
Where CurretlyReading="Yes"


I'm am sure you can get this sorted, ...keep me posted...

The kicker here is that the subform will *Always* display current books.

There is no "easy" way to remove the filter unless you change the recordsource...
There are other techniques, ...but I think that my first approach is what you wanted originally.

If you want something "ultimate"
Then you could create a "set up" form where it asks you how you want to open the sub form (All books, ...or current books), using this, you would set the default  to be "current", (so you don't have to do anything), ...but you could change it if you liked.

But this is something that could be considered later...
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

hnasrCommented:
Check:
Form's properties sheet> Data Tab > Filter On Load : Yes
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Richard WilliamsAuthor Commented:
Fortunately I knew where to look, and made the change, and it works.    Thank you very much.
0
Richard WilliamsAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for DrRichardWilliams's comment #a41040700

for the following reason:

Solution simple yet based on his knowledge.    Much simpler than other suggestions.
0
Jeffrey CoachmanMIS LiasonCommented:
No objection to the close, ...A few notes though, ...your question title was a bit confusing.
Instead of "Locking" the filter property on the form, you could just use a query to only show active books.
In this way you are not loading all the movies every time, ...then always using the form's resources to filter them out.
You also, then don't have to worry about setting any form properties. (as other settings may effect the FilterOnLoad property...

Then other side of this is that the query system may only be relevant if your recordset/recordsources are large.

JeffCoachman
0
Rob JurdEE Community AdvisorCommented:
I've requested that this question be closed as follows:

Accepted answer: 500 points for hnasr's comment #a41040508

for the following reason:

Accepting on behalf of the author
0
Richard WilliamsAuthor Commented:
HNASR answered my question completely and his reply works great.  I have applied it in 2 different Access databases and it is OK.   So thank you very much.
0
hnasrCommented:
Welcome!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.