本文介绍了请协助如何让每个组合框显示自己的列表,然后进行过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在认真努力将我的组合框集成到表单中.

I am seriously battling with integrating my combo boxes on a form.

我有 3 个组合框:

1- 公司 - cboComp - tblCompany

1- Company - cboComp - tblCompany

2- 类别 - cboCat - tblCategory

2- Category - cboCat - tblCategory

3- 机队编号 - cboFlt - tblFltNo

3- FLEET NO - cboFlt - tblFltNo

这些 (1&2) 然后通过 cboComp 与 tblFltSetup 的行源进行排序(标准)我已经设置了每个组合框,以便它们相互过滤,但只能根据cboComp 只要它有一个选择的值,如果在 cboComp 中没有选择值,那么其他 2 个组合框在它们的下拉列表中没有显示任何选择.这也适用于 cboFlt、cboComp &cboCat 必须有值,否则我无法为 cboFlt 选择值.

These (1&2) are then sorted(criteria) via cboComp with the row source of tblFltSetup I have setup each combo box so that they filter into each other but have only managed to figure out how to do this according to the cboComp as long as it has a value selected, and if there is no value selected in cboComp then the other 2 combo boxes show nothing to select in their drop down list. This also applies to cboFlt, cboComp & cboCat must have values else I cant select a value for cboFlt.

基本上我希望组合框(1,2 和 3)在下拉列表中显示它们各自的完整选项列表,无论其他组合框是否选择了值,但我希望组合框进行过滤根据每个单独的组合框相应地如果我决定只按 cboCat & 过滤例如 cboFlt.

Basically I want the combo boxes (1,2 & 3) to show their individual full list of options in the drop down regardless if any of the other combo boxes have a value selected but I then want the combo boxes to filter according to each individual combo box accordingly If I decide to only filter by cboCat & cboFlt for example.

这可能吗?我该怎么做?

Is this possible and how would I do this?

推荐答案

SELECT DISTINCT tblFltNoNatKey.FleetNo, tblFleet1.Companies, tblFleet1.Categories, tblFleet1.FleetNo从 tblFltNoNatKey INNER JOIN tblFleet1 ON tblFltNoNatKey.FleetNo = tblFleet1.FleetNoWHERE ((((tblFltNoNatKey.FleetNo)=[t​​blFleet1]![FleetNo]) AND (([Forms]![FuelLookup]![cboComp]) 为空) AND (([Forms]![FuelLookup]![cboCat])为空)) 或 (((tblFleet1.Companies)=[Forms]![FuelLookup]![cboComp]) AND ((tblFleet1.Categories)=[Forms]![FuelLookup]![cboCat])) OR ((((tblFleet1.Companies)=[Forms]![FuelLookup]![cboComp]) AND (([Forms]![FuelLookup]![cboCat]) 为空)) OR (((tblFleet1.Categories)=[Forms]![FuelLookup]![cboCat]));

SELECT DISTINCT tblFltNoNatKey.FleetNo, tblFleet1.Companies, tblFleet1.Categories, tblFleet1.FleetNoFROM tblFltNoNatKey INNER JOIN tblFleet1 ON tblFltNoNatKey.FleetNo = tblFleet1.FleetNoWHERE (((tblFltNoNatKey.FleetNo)=[tblFleet1]![FleetNo]) AND (([Forms]![FuelLookup]![cboComp]) Is Null) AND (([Forms]![FuelLookup]![cboCat]) Is Null)) OR (((tblFleet1.Companies)=[Forms]![FuelLookup]![cboComp]) AND ((tblFleet1.Categories)=[Forms]![FuelLookup]![cboCat])) OR (((tblFleet1.Companies)=[Forms]![FuelLookup]![cboComp]) AND (([Forms]![FuelLookup]![cboCat]) Is Null)) OR (((tblFleet1.Categories)=[Forms]![FuelLookup]![cboCat]));

这篇关于请协助如何让每个组合框显示自己的列表,然后进行过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 20:55