vba - 执行由第三个组合框列过滤的查询
问题描述
我需要执行由第三个组合框列过滤的查询
我有一个带有以下 rowSource 的组合框(例如):
SELECT Id, Two, Three, Four from AnyTable
绑定列是 Id(我需要它)
另一个组合框需要“三个”字段来使用以下 rowSource 进行过滤(例如):
SELECT IdTable2,Table2Two,Table2Three from AnyTable2 WHERE Table2Three=??????? 'Need to refer to value of column three of first Combo
我尝试了很多解决方案,但不起作用(语法)
我怎么能做到?
提前致谢
解决方案
您需要Column 属性。
列索引是从 0 开始的,所以你需要.Column(2)
SELECT IdTable2,Table2Two,Table2Three
FROM AnyTable2
WHERE Table2Three = Forms!myForm!myCombobox.Column(2)
推荐阅读
- mfc - Visual Studio 2019 对结构中的变量没有默认值提出警告
- python - 如何正确测试具有 REST API + Flask JWT 扩展的应用程序?
- c# - 无限路径路由到 ASP.NET Core 操作
- c# - 如何将一个类中的对象传递到另一个类的列表中?
- c# - 通过 JQuery 检测 iFrame SRC 更改
- json - 将 JSON 文件绑定到 Angular 7 中的变量
- angular - 我如何在角度实现动态复选框
- intellij-idea - IntelliJ IDEA 项目模块与 Java 9 模块的概念不同吗?
- .net - 来自 .NETFramework 开发人员包的 DLL 参考
- awk - 来自字符串的 awk 算术运算