Private mintControlCount As Integer
Private mintIndexCount as Integer
Private intIndexes() as Integer
Private Sub Remove(Index As Integer)
'You cant unload the original control (In my case it is objItems(0))
If Index <> 0 Then
'You dont need to add to the indexes if the removed control is
'the last control
If mintControlCount - 1 <> Index Then
'Add a new item to the index array
Redim Preserve intIndexes(mintIndexCount)
intIndexes(mintIndexCount) = Index
'Iterate the index counter
mintIndexCount = mintIndexCount + 1
End If
Unload objItems(Index)
'De-Iterate the control counter
mintControlCount = mintControlCount - 1
End If
End If
End Sub