• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Easy Microsoft Access/VB question

Sanchez

OSNN Junior Addict
#1
I have a combo box in a form and I want to search it for certain strings. Right now I'm only doing

If Me.Combo0.text = "hello" then whatever...

But that only tests the text that is currently selected. How would I test every entry in the combo box to see if any entry was "hello".

If I can't test everything in the combo box how can I check every entry in the column of the table that the combo box is based on.

Thanks. You guys rock.
:eek:
 

XPos

OSNN Addict
#2
This will test the list box.

Code:
Dim I as Integer

For I = 0 to Combo.ListCount - 1
   if Combo.List(I) = "Hello" then
      'whatever...
      Exit For
   End If
Next I
 

Members online

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,961
Messages
673,239
Members
89,013
Latest member
Pdawgintown