-
:D In my programm, there is a listbox in which different
numbers are added (001 025 027 145..).
Then tere's a text-box in which different numbers are
printed. Now I want that a message comes up, if this number
exists already in the listbox (Visible = false). But the
problem is, that this Listbox must have a focus and only
marked items are working like I want.
Yet I use this: ____ INP2 = textbox L4 =List
Code:
If INP2.Text = L4 Then MsgBox "Number exists!!"
Is it possible that I can compare the textbox
with all the items in the listbox, without using a focus
and without marking an item in the listbox ?
[i] I hope, you understood my problem,
thanx for some tips, Matt-D(eutschland) :)
-
Do you really need to have the listbox, is it always invisible? Yes it's possible to compare each item, just loop from 0 to listcount-1. Use if Selected(index) to check if it's selected or not.
-
You can use the List property. :rolleyes:
Code:
Dim X As Integer
For X = 0 To L4.ListCount - 1
If INP2.Text = L4.List(X) Then
Call MsgBox("Number exists!", vbInformation)
Exit For
End If
Next