Filter Continuous Form with 2 combobox

Jonny45wakey

Member
Local time
Today, 18:49
Joined
May 4, 2020
Messages
48
Happy New Year to All :)

I've been searching for a solution to enable me to filter a continuous form using 2 comboboxes but without success!

On the form are the following:-

Combobox 1 = "CboYEAR" - rowsource has value list of Years from 2022 onwards
Combobox 2 = "CboCELL - rowsource has value list of production cells eg "Welding"

In the datasheet on the form there are the following fields:-

Field 1 = textbox "YEAR"
Field 2 = textbox "CELL"

What i would like to achieve is the user selects the YEAR in 1st Combobox then selects the CELL in the 2nd Combobox and then the form filters accordingly based on these 2 criteria.

Any ideas much appreciated.

Thanks

Jonny
 
This is just setting a form filter in the afterupdate of each control, I would have thought?
Combos would need to be on a mainform, unbound, with your continuous form as a subform.

That is how I would approach it.
 
see this demo and the Code behind the AfterUpdate event of each combobox.
 

Attachments

Thanks Gasman & arnelgp

I tried both ideas thanks, unfortunately the attachment from arnelgp didnt work.

I have managed to filter the subform from the mainform by "CboYEAR" but then i cant get the second combobox "cboCELL" to filter the data on the subform by Cell within the selected year (if that makes sense)

My Code on the "cboYEAR" is as follows

1672925587707.png
 
unfortunately the attachment from arnelgp didnt work.
because the sample has No Subform.
did the "demo" did not work also, cause i test it before uploading.
 
here try this with subform.
 

Attachments

Thanks Gasman & arnelgp

I tried both ideas thanks, unfortunately the attachment from arnelgp didnt work.

I have managed to filter the subform from the mainform by "CboYEAR" but then i cant get the second combobox "cboCELL" to filter the data on the subform by Cell within the selected year (if that makes sense)

My Code on the "cboYEAR" is as follows

View attachment 105573
Arnel's code works, I tried it myself.
 
Thanks for the continued support from arnelgp & Gasman

This is the error i get when using the Year and Activity Filters

1672928218786.png
 
As that is not arnel's form, have you copied the code in his demo form to yours? :(
It is called FilterMe ?

=FilterMe()
 

Users who are viewing this thread

Back
Top Bottom