|
-
Apr 3rd, 2000, 09:14 PM
#1
Thread Starter
Member
I have a collection call colors. I have about 15 color elements in this collection.
When I'm adding colors to the collection is there away to see if one of them already exist. For example lets say element #3 is blue, but at 16 the user wants to add blue again, how could I test to see if its already there
Thanks
-
Apr 3rd, 2000, 09:38 PM
#2
You can modify this:
Dim sDummy As String
Dim bFound As Boolean
On Error Resume Next
'If the text is in the collection, Err = 0, otherwise it's not
sDummy = MyCollection.Item(Text1.Text)
bFound = (Err = 0)
If bFound Then
Err.Clear
MsgBox "Already in list"
Else
List1.AddItem Text1.Text
MyCollection.Add Text1.Text, Text1.Text
End If
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
|