简体   繁体   English

查询MS-Access表单组合框

[英]Query MS-Access Form ComboBox

as the title suggests I am writing SQL out of excel vba to query Forms contents out of a MS-Access db. 如标题所示,我是用excel vba编写SQL来查询MS-Access数据库中的Forms内容。 The SQL works fine however, the fields where combo boxes are, the SQL returns their index instead of the text field. SQL工作正常,但是组合框所在的字段,SQL返回其索引而不是文本字段。

I spent some time googling this but most of the results are asking how to display on the form in the combo box, I am just trying to return the text display form the combo box with my SQL. 我花了一些时间进行谷歌搜索,但是大多数结果都询问如何在组合框的表单上显示,我只是想用SQL返回组合框的文本显示。

I will go ahead and say the person who designed this did a bad job, and the tables relating to these drops down have nothing in common(the tables are just a list of the drop down values and ID's). 我会继续说,设计此功能的人做得不好,与这些下拉列表相关的表没有任何共同点(这些表只是下拉列表值和ID的列表)。

My question is what is the best way to return this value? 我的问题是返回此值的最佳方法是什么? Can I join based off the drop down index? 我可以根据下拉索引加入吗?

This link should help you get started. 此链接应帮助您入门。

http://access.mvps.org/access/forms/frm0031.htm http://access.mvps.org/access/forms/frm0031.htm

Something like this, I presume... 我想是这样的...

Forms!Mainform.RecordSource 表格!Mainform.RecordSource

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

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