-
July 12th, 2009, 06:13 AM
#1
Basic combo boxes
hi there,
i am adding a combox box to a visual basic application.
currently im using the .additem("somestring") method, but i was wondering if there is a way to add a
value and a number. (like in web programming) ie if the combox box is populated by a database can it
have the an index value (thats not displayed) that is the id in the database and the actual display
value as the string which the ID corresponds to.
Example:
the databse contains
ID Town
1 Sydney
2 Canberra
I want the list to display Sydney and Canberra, but when i retrieve what value was selected im only
interested in the ID, ie 1 and 2.
I would also like to carry this behaviour to checkboxes.
Can anyone shed some light on this?
Thanks in advance.
-
July 12th, 2009, 09:15 AM
#2
Re: Basic combo boxes
combo1.additem "Sidney"
combo1.itemdata(combo1.newindex) = 1
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
|