Hi all,
I've been able to get an array populated with a listbox in a form. But what I want to do is to keep adding to this array once the user has added more items to the listbox and clicked the "Add to Array" button again. I can't figure out how to store/remember the 1st set of items so that when the sub is called again (from clicking the button) it will just add the next set of items instead of creating a new array.
Any help would be great.
Below is what I have so far:
Public Sub cmdList_Click()
Dim arrLayers()
intCount = ListBox2.ListCount
ReDim arrLayers(intCount)
For i = 0 To ListBox2.ListCount - 1
strLayerName = ListBox2.List(i)
arrLayers(i) = strLayerName
Next i
End Sub
I've been able to get an array populated with a listbox in a form. But what I want to do is to keep adding to this array once the user has added more items to the listbox and clicked the "Add to Array" button again. I can't figure out how to store/remember the 1st set of items so that when the sub is called again (from clicking the button) it will just add the next set of items instead of creating a new array.
Any help would be great.
Below is what I have so far:
Public Sub cmdList_Click()
Dim arrLayers()
intCount = ListBox2.ListCount
ReDim arrLayers(intCount)
For i = 0 To ListBox2.ListCount - 1
strLayerName = ListBox2.List(i)
arrLayers(i) = strLayerName
Next i
End Sub