Archie
April 14th, 2001, 08:59 AM
Using the code below, what code would I have to add in order to ensure that an item is added only one time? (if I already added it to the second list and tried to add it again using the command button, an error msg should pop up) Thank you.
private Sub cmdAdd_Click()
Dim i as Integer
for i = 0 to List1.ListCount - 1
If List1.Selected(i) = true then List2.AddItem List1.List(i)
End If
next
End Sub
private Sub Form_Load()
Dim aLine as string
Open App.Path & "\grocery.txt" for input as #1 Do While Not EOF(1)
Line input #1, aLine
List1.AddItem aLine
Loop
Close #1
End Sub
Archie Kantzavelos
private Sub cmdAdd_Click()
Dim i as Integer
for i = 0 to List1.ListCount - 1
If List1.Selected(i) = true then List2.AddItem List1.List(i)
End If
next
End Sub
private Sub Form_Load()
Dim aLine as string
Open App.Path & "\grocery.txt" for input as #1 Do While Not EOF(1)
Line input #1, aLine
List1.AddItem aLine
Loop
Close #1
End Sub
Archie Kantzavelos