在 Access VBA 中获取 Combobox.Value

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7680171/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 12:00:53  来源:igfitidea点击:

Getting Combobox.Value in Access VBA

ms-accessvbacomboboxms-access-2007

提问by hrezs

I have this code:

我有这个代码:

If Me.Combobox.Value = "My Text" Then

As I want to test if "My Text" is the only value selected, however, the conditional is skipped.

由于我想测试“我的文本”是否是唯一选择的值,因此跳过了条件。

I have also tried

我也试过

Me.Combobox.Column(1)

and

Me.Combobox.Text

I believe there is some simple solution that I'm just overlooking.

我相信有一些我只是忽略的简单解决方案。

回答by hrezs

Me.Combobox.Column(1)decided to work as I retested the possibilities.

Me.Combobox.Column(1)决定工作,因为我重新测试了可能性。