|
-
Apr 8th, 2001, 07:25 PM
#1
Thread Starter
Junior Member
I was wondering how to use the listview.finditem before loading items into the list, then form an if statement on either not adding if it is allready there and adding if it isn't..... can anyone tell me how this is done? or if there is an easier way to prevent duplicate items plz let me know, thanks
-
Apr 8th, 2001, 07:35 PM
#2
Addicted Member
You could use a key. When there's the same key twice an error occurs.
Code:
On Error Resume Next
ListView1.ListItems.Add , Key, Text
If Err.Number <> 0 Then 'The key exists twice
'do some handling stuff...
End If
Err.Clear
Hope this helps,
Dennis.
Code that I author is neither elegant nor efficient. It is, however, functional. Once I get something that works, I'm generally satisfied with myself - I mean, if it works, that's good enough, right?
Originally posted by aknisely
Sorry, but I feel uncomfortable on CC with clothes on
__________________
The truth ... is out there!
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
|