|
-
Oct 11th, 2000, 07:34 PM
#1
Thread Starter
Lively Member
adding collections.
i have added a collection to my project in a class module
but i get errors when trying to run it
what am i doing wrong help me please???
Code:
Private colDetails As New collection
'then using a function
colDetails.add newDetail, CStr(.id)
'and i get a runtime error '457'
'the key is already associated with an element of this
'collection any ideas what that means????
-
Oct 11th, 2000, 08:33 PM
#2
Can you give more detail. What is newDetail and .id
-
Oct 11th, 2000, 10:02 PM
#3
Hyperactive Member
collection's index is already being used
Look at the syntax def for the add method in collections. The index field must be unique. You're adding an existing index.
-
Oct 11th, 2000, 10:17 PM
#4
You already have an item ...
Whatever is the value of the CStr(.ID) has already been used with some other item, I think. The index of the item to be added has to be unique.
If this is the problem, try to add elements with a unique index, or try to generate an index whenever an item is added to the collection.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|