Link to home
Start Free TrialLog in
Avatar of isnoend2001
isnoend2001Flag for United States of America

asked on

Select item in combo box using the text property

I have a combo box that holds titles of different sections of an .ini file. When a selection is made it gets the data from .ini file. The data is then loaded into a Mshflexgrid. Users can add and rename sections. I have 1 section that cannot be renamed or deleted called "All Materials". I never know the index as it can change when sections are added or deleted
How can i programically select "All materials"
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of isnoend2001

ASKER

Thank you
I modified it to select the item and it works.
For l = 0 To Combo1.ListCount - 1
    If Combo1.List(l) = "All Materials" Then
        'Combo1.Text = Combo1.List(l)
Combo1.ListIndex = 1
        Exit For
    End If
Next l
Dim l As Integer
For l = 0 To Combo1.ListCount - 1
    If Combo1.List(l) = "All Materials" Then
        'Combo1.Text = Combo1.List(l)
 Combo1.ListIndex = 1
        Exit For
    End If
Next l
Yes. That, too, would do it.