|
-
Oct 23rd, 2003, 10:14 AM
#1
Combo box entry based on the ItemData
How do you find a combo box entry based on the ItemData. I'm loading a combo box with entries from a description field. I'm using the primary key for that table as the item data for each description. Now if I know the primary key how do i display the correct item in the combo box. Here is a quick sample.
Assume I have loaded a combo box with this data
Apple ItemData = 1
Orange ItemData = 2
Banana ItemData = 4
Grapes ItemData = 7
Now lets say I know the itemData is 4. How would I display Banana
-
Oct 23rd, 2003, 10:18 AM
#2
Frenzied Member
Doesnt it have an Index X function, like a list box? Or am i misunderstanding something ? hehe
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Oct 23rd, 2003, 10:24 AM
#3
The listIndex is sequential. I can't use that because Items may have been delete in the table so the ItemData will not match the ListIndex
-
Oct 23rd, 2003, 10:32 AM
#4
Frenzied Member
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Oct 23rd, 2003, 10:48 AM
#5
Originally posted by MarkT
The listIndex is sequential. I can't use that because Items may have been delete in the table so the ItemData will not match the ListIndex
Yes it will, the List and Itemdata may be two separate arrays, but they are synchronised. ie: Itemdata(3) will ALWAYS be the itemdata for List(3), no matter how many items have been removed/added.
This means you can do a simple for loop on the itemdata, then set the listindex to the matching array position.
-
Oct 23rd, 2003, 10:54 AM
#6
-
Oct 23rd, 2003, 10:56 AM
#7
Frenzied Member
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
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
|