Solved

adding item to list view exits sub if its a duplicate.

Posted on 2004-08-18
2
271 Views
Last Modified: 2010-05-02
how can i add a item to a listview while having it exit sub if its a duplicate?
0
Comment
Question by:andyakira
2 Comments
 
LVL 50

Accepted Solution

by:
Ryan Chong earned 250 total points
ID: 11837894
Try use FindItem method, like:

...
Dim tmpItem As ListItem, i As Integer
    Set tmpItem = listview1.FindItem(mytext)
    If tmpItem Is Nothing Then
        i = listview1.ListItems.Count + 1
        'listview1.Sorted = False
        listview1.ListItems.Add i, , myext
        'listview1.Sorted = True
    End If
...

cheers
0
 

Author Comment

by:andyakira
ID: 11837935
works great, ty
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question