Forum Discussion
Filter a form with a button (subform)
- Apr 30, 2022
Thanks for the additional information. The screenshot showed only the filter on the datasheet view, so I misinterpreted the situation. Yes, that does make it possible.
I would actually use a combo box, rather than a command button, though, because the button still has to have a value on which to filter and that has to come from somewhere.
In fact that is a very standard approach to making forms more efficient by limiting records in a form's recordset. That's crucial to working with remote databases, such as SQL Server.
The attached demo is intended for a very different purpose, but the combo box to filter a recordset in a subform is pretty much the same as what you need and can be adapted.
My unbound form is actually in form view and this is where the button would be placed...not in the subform that is in datasheet view (this is the subform to filter). What I mean by more efficient is that is quicker to press a button than to click the filter icon and then click again the item you want to filter out of all the choices available. Let me know if that changes anything. thank you.
Thanks for the additional information. The screenshot showed only the filter on the datasheet view, so I misinterpreted the situation. Yes, that does make it possible.
I would actually use a combo box, rather than a command button, though, because the button still has to have a value on which to filter and that has to come from somewhere.
In fact that is a very standard approach to making forms more efficient by limiting records in a form's recordset. That's crucial to working with remote databases, such as SQL Server.
The attached demo is intended for a very different purpose, but the combo box to filter a recordset in a subform is pretty much the same as what you need and can be adapted.
- Tony2021May 01, 2022Iron ContributorThank you George. Little above my head but I will see if I can get it to work.
- isladogsMay 01, 2022MVPIn case it helps, I have two more examples at https://www.isladogs.co.uk/multiple-group-filter/index.html
- Tony2021May 01, 2022Iron ContributorHi isladogs, thanks for the response.
When posting the question, I had thought this would be more simple than it is. I looked over your db for awhile and its a little too complicated for my level. For me, the filtering was only a nice to have and I will resort to using the filter icon on my datasheet as I have been.
thank you both.