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>
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,214,918
Messages
6,122,243
Members
449,075
Latest member
staticfluids

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
Back
Top