pozitron969
Programmer
Hello all,
How does one update information in a collection after it has been added to said collection? I have a collection of classes that store media files. I am setting the key for each item to be the filename, and I don't really want to use index #'s. Here is what my app does:
1) The user clicks on an item in the list and it gets the class from the collection based on the key.
2) The user updates the information and I write it to a temporary class variable.
3) The user clicks on another item in the listbox and I am trying to save the temporary class variable before loading the new one to be edited.
Here is the statement that it is erroring at:
[tt]
Public myPlaylist As New Collection
Public myMedia As New clsMediaFile
...
...
Private Sub SaveProp()
If sCurrentKey <> "" Then Set myPlaylist.Item(sCurrentKey) = myMedia
End Sub[/tt]
I get the error Run-time error '438' Object doesn't support this property of method
Thank you
How does one update information in a collection after it has been added to said collection? I have a collection of classes that store media files. I am setting the key for each item to be the filename, and I don't really want to use index #'s. Here is what my app does:
1) The user clicks on an item in the list and it gets the class from the collection based on the key.
2) The user updates the information and I write it to a temporary class variable.
3) The user clicks on another item in the listbox and I am trying to save the temporary class variable before loading the new one to be edited.
Here is the statement that it is erroring at:
[tt]
Public myPlaylist As New Collection
Public myMedia As New clsMediaFile
...
...
Private Sub SaveProp()
If sCurrentKey <> "" Then Set myPlaylist.Item(sCurrentKey) = myMedia
End Sub[/tt]
I get the error Run-time error '438' Object doesn't support this property of method
Thank you