|
-
Jan 17th, 2001, 10:19 AM
#1
Thread Starter
Hyperactive Member
Dear VB users,
I am making a combobox with two types of information.
The first kind of information is a name, the second one is an ID to a database.
In priciple I don’t want to see the ID in the combobox. After selecting I want to see my name inclusive the ID number.
Can someone give me a solution??
Nice regards,
Michelle.
-
Jan 17th, 2001, 10:25 AM
#2
PowerPoster
michelle, All you need is juz make use of the ComboBox's ItemData properties to store the ID.
Code:
Private Sub Combo1_Click()
MsgBox Combo1.Text & " --- " & Combo1.ItemData(Combo1.ListIndex)
End Sub
Private Sub Form_Load()
Dim n As Integer
With Combo1
For n = 0 To 10
.AddItem "Item " & n
.ItemData(n) = n
Next
End With
End Sub
-
Jan 17th, 2001, 12:24 PM
#3
Thread Starter
Hyperactive Member
Hello Chris,
Thanks you very much for your information.
Michelle.
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
|