在Access中,我试图从列表框中提取选定的项目。
我已经有一段时间没有使用列表框对象了,但是我似乎记得,您必须遍历选定的项目,然后使用该List
方法提取它们。
我的研究支持这一ascertation,但我到相对于使用的问题上运行List
-
编译错误:找不到方法或数据成员
打印每个选择返回的lstLocations.Selected(i)
sees -1
,并且List
显然不存在,那么如何提取选择的值?
Dim i As Integer
For i = 0 To lstLocations.ListCount - 1
If lstLocations.Selected(i) Then
Debug.Print lstLocations.List(i)
End If
Next i
使用for每个循环在选定的项目之间循环。就像是
Dim item As Variant
For Each item In Me.lbx_booking.ItemsSelected
If Not (Nz(Me.lbx_booking.Column(0, item), "") = "") Then
End If
Next item
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句