So can anyone at least help me take the selected values and put them into an array.
Here is my msgbox code.
Expand|Select|Wrap|Line Numbers
- Public Function lstbox_array()
- Dim i As Long
- Dim Msg As String
- With frm1.lst_country
- For i = 0 To frm1.lst_country.ListCount - 1
- If .Selected(i) Then
- Msg = Msg & frm1.lst_country.List(i) & vbCrLf
- End If
- Next i
- End With
- If Len(Msg) = 0 Then
- Msg = “No items selected”
- End If
- MsgBox Msg
- End Function
Expand|Select|Wrap|Line Numbers
- Public Function lstbox_array()
- Dim i As Long
- Dim Msg As String
- 'Dim listArray()
- 'Dim j As Long
- 'Dim vArray
- 'ReDim listArray(1 To frm1.lst_country.ListCount, 1 To 1)
- With frm1.lst_country
- For i = 0 To frm1.lst_country.ListCount - 1
- If frm1.lst_country.Selected(i) Then
- Msg = Msg & Left(frm1.lst_country.List(i), 3) & vbCrLf
- 'j = j + 1: listArray(j, 1) = frm1.lst_country.List(i, 1)
- 'vArray(i) = frm1.lst_country.List(i, 1)
- 'listArray(i, 0) = Left(frm1.lst_country.List(i), 3)
- End If
- Next i
- End With
- If Len(Msg) = 0 Then
- Msg = "No items selected"
- End If
- 'Debug.Print listArray(i)
- MsgBox Msg
- End Function
i figure once i can get the selected items into a new array, it shouldn't be too much of a problem to parse through those and add them to the SQL WHERE statements.
Thank immensely ahead of time for anyone's help and or direction.
Cheers,
Eric