[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Select item in combo box using the text property

Posted on 2007-11-24
4
Medium Priority
?
195 Views
Last Modified: 2010-04-30
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"
0
Comment
Question by:isnoend2001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 1000 total points
ID: 20343284
Not sure how you want to use it, but let's start with this

Dim l As Integer
For l = 0 To Combo1.ListCount - 1
    If Combo1.List(l) = "All Materials" Then
        Combo1.Text = Combo1.List(l)
        Exit For
    End If
Next l
0
 

Author Closing Comment

by:isnoend2001
ID: 31410778
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
0
 

Author Comment

by:isnoend2001
ID: 20343316
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
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 20343468
Yes. That, too, would do it.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question