表单 onLoad 中的代码:
country_combo.RowSourceType = "Value List"
重置函数中的代码:
Dim lListIndex As Long
With Me.country_combo
For lListIndex = .ListCount - 1 To 0 Step -1
.RemoveItem (lListIndex)
Next lListIndex<br/>
End With
填充国家组合的代码:
*For n = 1 To numCountries*
*countryCombo.AddItem (countryRS.Fields("countryName"))*
*countryRS.MoveNext*
*Next n*
在填充国家/地区组合框的代码运行后,我遇到了一个问题。这些值在那里,因为我可以运行 Debug.Print(countryCombo.Value) 并打印出所选国家/地区的名称,但我根本看不到组合框中的值。它们是不可见的,据我所知,特定项目没有可见性属性,除非我完全弄错了。
comboBoxError.png http://img110.imageshack.us/my.php?image=comboboxerror.png