Combo Filtering a Subform question

healey21

Well-known Member
Joined
Dec 22, 2009
Messages
900
Hello All,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p> </o:p>
I have an unbound form with some combo boxes and I also have a subform which shows around 88000 records, what I would like to do is select a year from the combo box and it filters the subform content. My concern is the combo box uses numeric numbers from a table but the subform has the year as a text field.<o:p></o:p>
<o:p> </o:p>
Their names as follows:<o:p></o:p>
<o:p> </o:p>
The combo box is called cboUnderwritingYear<o:p></o:p>
The subform name is frmCombinedSearchEngine<o:p></o:p>
The subform also sits inside a child facility called child27<o:p></o:p>
<o:p> </o:p>
I have been trying to work with the following code but it fails each time.<o:p></o:p>
<o:p> </o:p>
Me.frmCombinedSearchEngine.Form.Filter = "[Underwriting Year]=" & Chr(34) & Me.cboUnderwritingYear & Chr(34)<o:p></o:p>
me.frmCombinedSearchEngine.Form.FilterOn = True<o:p></o:p>
<o:p> </o:p>
I also tried setting the combo box as the criteria in the query but when I open the form before selecting anything my records are reduced to around 33000<o:p></o:p>
<o:p> </o:p>
Any guidance would be very much appreciated. <o:p></o:p>
 

Some videos you may like

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Watch MrExcel Video

Forum statistics

Threads
1,122,371
Messages
5,595,777
Members
414,020
Latest member
Meghdad

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top