简体   繁体   中英

Filter a Subform with a ComboBox - ACCESS 2013

How do I filter a Subform with a ComboBox. I have a ComboBox called FETextbox, it is populated with names from [tblMatterList]![Lead_FE]. I also have a subform called SubFormPF which when I select a name from FETextbox I want to filter to only show the rows with that name.

Here's what I have so far, this worked with a TextBox but doesn't with a combo box.

Private Sub FETextbox_Change()
Me.Filter = (Me.FETextbox = qryPlannedHours.Lead_FE)
Me.FilterOn = True
End Sub

Any help is much appreciated! If I've missed anything to help you let me know.

The filter property needs to be set to a string that is the where part of a select statement (without the word "where").

https://msdn.microsoft.com/en-us/library/office/ff194672.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM