The Most Powerful form Filter and Requires almost No Code

By default, the list option is limited to 1000 records but that can be increased.

1716415138458.png

However, if the limit is very large, performance will suffer
For similar reasons, fields in linked ODBC tables are normally excluded
 
By default, the list option is limited to 1000 records but that can be increased.

View attachment 114214
However, if the limit is very large, performance will suffer
For similar reasons, fields in linked ODBC tables are normally excluded


Thank you very much to you and tomasm for your replies. The table only has 99 records, though the field the control is tied to is a foreign key and that table has 654 records. But just in case, I increased the number of records to read to 10000, and clicked the ODBC fields option. This didn't help. The two filters on the form are reading from the same table and they work just fine. I included a copy of the database scrubbed of identifying info, with a few fake entries. The form in question is frmInjuries. The filter in question is the one that doesn't work obviously, it's the one that's under Employee. I feel like this is me missing something simple.

EDIT 5/23/24 0927

I messed up with the cleaned database, and also messed up my main one, due to forgetting one of the tables was a linked table. Fixed it and re-added.



employeefilter.png




foremanfilter.png
 

Attachments

Last edited:
I've had a quick look at your database but am not clear what I'm meant to be looking at.
The screenshot appears to be for form frmInjuries but the buttons look different.
I have no idea where the code is that triggers the dropdowns when you click the buttons - there's no event procedures or embedded macros so I've no idea what's going on.

You may find it useful to review my recent article on this topic - it has 2 pages:
 
I used the code arnelgp posted in this thread. Did you get a warning about macros being blocked? I re-downloaded the database, and it said that and showed the button captions, Command80, Command76, and Command77. But I moved it to a folder that didn't have macros blocked, and it showed up like it does in the screenshot.

Should I have posted a new thread/question? I just assumed since the file was posted here that was the right place to do so.
 
I've reopened the file and I now see the down arrows. The file was trusted previously and the code worked...but the images weren't displayed
However as I haven't looked at @arnelgp's code in this thread, its probably better to leave someone else to explain what's going on
As I've tagged @arnelgp, he should get alerted to the post and may be better placed to advise

However, you may find my approach to applying a multi-select filter in a continuous form works just as well and (possibly) with less code

I think a new thread would have been more suitable with a link back to the relevant posts in this thread.
 
May want to read my addendum which explains how the images work using the gallery.
 
Very cool - my only thing I might suggest (which might not be practical) dynamically adjust the width of the drop down window to the width of the widest selectable item...

One thing I used to do in my MS Access applications in tabulated forms was to have the labels activated and set to sort alphabetically ascending on left click and descending on a right click.. and normally I would make sort on multiple columns... depending on my own preference and with respect to my opinion on a sensible sort on the column. Not quite a filter but worked well for many of my applications.

Here's a link to my notes on it from ten years ago.
Sorting on Mouse Left and Right Click
 
Last edited:

Users who are viewing this thread

Back
Top Bottom