|
-
Sep 7th, 2000, 09:23 AM
#1
Thread Starter
New Member
My code is currently written to select or highlight the first row in a combobox. For example:
cboExample.ListIndex = 0
I need it to select or highlight the row that applies to the selected ID. If I write code to try to select a different row, I get an error. Here's an example:
cboExample.ListIndex = i
What is the best practice for specifying a row in a single-select combobox when you know what ItemData to look for??
Thanks...
 TM
-
Sep 7th, 2000, 09:35 AM
#2
Frenzied Member
Do I get you right or...
...am I brabbling bullshit
You want to select a specific Item in a ComboBox?
you could just use this:
Code:
Combo1.AddItem "Jop"
Combo1.AddItem "TragAnn"
Combo1.Text = Combo1.List(1)
But I'm not quite sure if that's what you mean. Anyway, let me know (please)
BTW, this code works to but be sure to give i a number:
Code:
Dim i As Integer
i = 1
Combo1.AddItem "Jop"
Combo1.AddItem "TragAnn"
Combo1.ListIndex = i
That's what you needed?
[Edited by Jop on 09-07-2000 at 10:40 AM]
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Sep 7th, 2000, 10:10 AM
#3
Thread Starter
New Member
Yep
Jop - Yes...thanks for the help. I was over-complicating the issue, plus I found some erroneous code below the piece I was working with that was resetting the ListIndex back to 0. Not good. Cleaned that up and works like a champ.
Peace.
 TM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|