简体   繁体   English

使用ComboBox过滤子窗体 - ACCESS 2013

[英]Filter a Subform with a ComboBox - ACCESS 2013

How do I filter a Subform with a ComboBox. 如何使用ComboBox过滤子表单。 I have a ComboBox called FETextbox, it is populated with names from [tblMatterList]![Lead_FE]. 我有一个名为FETextbox的ComboBox,它填充了来自[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. 我还有一个名为SubFormPF的子表单,当我从FETextbox中选择一个名称时,我想过滤以仅显示具有该名称的行。

Here's what I have so far, this worked with a TextBox but doesn't with a combo box. 这是我到目前为止,这与TextBox一起工作,但没有组合框。

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"). 需要将filter属性设置为一个字符串,该字符串是select语句的where部分(不带“where”一词)。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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