【发布时间】:2014-09-22 19:08:22
【问题描述】:
如果组合框 1 显示“德国家庭购物”,如果给出以下数组,我的用户窗体上有 2 个组合框
If ComboBox1.Value = "Germany Home Shopping" Then
ComboBox2.List = Array("GER Singles ABE", "GER Singles CDF", "GER Small Cat ABE", "GER Small Cat CDF", "GER Small Cat All Zone", "GER Large Cat ABE", "GER Large Cat CDF", "GER Large Cat All Zone")
End If
我也想反其道而行之,如果该值是组合框 2 中的数组答案之一,那么它将把德国家庭购物放在组合框 1 中。我认为可以这样完成吗?
If ComboBox2.List = Array("GER Singles ABE", "GER Singles CDF", "GER Small Cat ABE", "GER Small Cat CDF", "GER Small Cat All Zone", "GER Large Cat ABE", "GER Large Cat CDF", "GER Large Cat All Zone") Then
ComboBox1.Value = "Germany Home Shopping"
End If
但这似乎对我不起作用。
提前致谢 :-) 铝
【问题讨论】:
-
更改您的 if 语句以循环遍历数组测试,如
for each ele in Array(x, y ,z): if combobox2.selecteditem = ele then: combobox1.value = "Germany etc..": exit for: end if: Next -
@Cor_Blimey 我收到一个编译错误,说明方法或数据成员未找到?