Hi, I am trying to obtain the values of items selected in a list box for the purpose of building a string.
I can get the count of Items selected and loop through the count but I can't move to the next item selected to obtain the next value.
This is what I have so far:
Dim frmCnt, frmListCount As Long
Dim frmType As String
'Obtain the value of each item selected in the list box.
With Me.lstForms
For frmCnt = 0 To frmListCount - 1
If .Selected(frmCnt) Then
frmType = Me.lstForms.Column(0)
'need to move to the next frmType
End If
Next frmCnt
End With
frmType = Me.lstForms.Column(0) - is the problem. It picks up the first row in the list box but I don't know how to pick up the next item(s) selected.
Any help would be appreciated.
Thanks, Dan
I can get the count of Items selected and loop through the count but I can't move to the next item selected to obtain the next value.
This is what I have so far:
Dim frmCnt, frmListCount As Long
Dim frmType As String
'Obtain the value of each item selected in the list box.
With Me.lstForms
For frmCnt = 0 To frmListCount - 1
If .Selected(frmCnt) Then
frmType = Me.lstForms.Column(0)
'need to move to the next frmType
End If
Next frmCnt
End With
frmType = Me.lstForms.Column(0) - is the problem. It picks up the first row in the list box but I don't know how to pick up the next item(s) selected.
Any help would be appreciated.
Thanks, Dan