What is the correct way to release all of the memory used by an array of UDTs when the UDT members contain variable length strings? Is Erase enough? Or do I need to clear out the strings in each UDT?
For example...
Code:Private Type Person FirstName As String LastName As String End Type Private People() As Person Private Sub Form_Load() Dim i As Long ReDim People(1 To 100) For i = 1 To 100 With People(i) .FirstName = "Joe" .LastName = "Smith" End With Next '//cleanup '...is this necessary? For i = 1 To 100 With People(i) .FirstName = vbNullString .LastName = vbNullString End With Next '...or is this all I need to do? Erase People End Sub




Reply With Quote
