How do u find a username in a listbox?
you loop through every item in the listbox and compare the value of the current item with the username you want to find
Here's an example which might help. This piece of code searches a listbox for a string (say, a persons username). If it finds it, the loop exits.
For i = 1 To ListBoxName.ListCount
If StringYouareComparing = ListBoxName.List(i) Then
found = True
Exit For
Else
found = False
End If
Next i
ok ill try that...
Is found supposed to be a string, integer or something?
Looks like it's supposed to be a boolean: it's assigned the values "true" and "false."
Yes, it is a Boolean. I didn't put the declares in...
If StringYouareComparing = ListBoxName.List(i-1) Then
I believe it should actually be that since the list starts at 0.
Actually, you are right. :)
Thanx, I'll give it a go...:)