-
I'm still no having any luck.
I'm grabbing text from four texboxes and adding it to a list view with four columns with the click of a button. What is the Syntax for checking if the data I'm about to add to the listview already exists? Here's my current code that adds data to my columns
Private Sub cmdAddToListView_Click()
Set sitem = lstCustomers.ListItems.Add(, , txtFields(1).Text)
sItem.SubItems(1) = txtFields(2).Text
sItem.SubItems(2) = txtFields(3).Text
sItem.SubItems(3) = txtFields(4).Text
End Sub
Thanks,
[Edited by vbNuBee on 09-17-2000 at 10:01 PM]
-
Hope it helps
Code:
Private Sub Command1_Click()
'Get the text in the box first
Dim Uper As Integer
Dim low As Integer
Dim Loops As Integer
Dim rVal As String
For Loops = 0 To List1.ListCount
List1.ListIndex = Loops
rVal = List1.Text
If rVal = "One" Then MsgBox "It's already in there "
If rVal <> "One" Then List1.AddItem "One"
Next Loops
End Sub
Private Sub Form_Load()
List1.AddItem "One"
List1.AddItem "Two"
End Sub