Solved

how to read the itemdata of a selected item in combo

Posted on 2002-04-19
6
276 Views
Last Modified: 2010-05-02
I have entered a long as itemdata as I loaded the combo box. Now when the user selects an option in the combo i want to be able to read the corresponding value I loaded in the itemdata property.

I cannot find any info on this.

Can anyone help

Thanks

Merlin007

0
Comment
Question by:merlin007
6 Comments
 
LVL 3

Expert Comment

by:Gunsen
ID: 6953206
Combo1_Click()
MsgBox Combo1.ItemData (Combo1.ListIndex)
End Sub
0
 
LVL 14

Accepted Solution

by:
ajexpert earned 100 total points
ID: 6953207
This snippet will give selected Item Name with Item Data
    Dim Msg As String
    Msg = Combo1.ItemData(Combo1.ListIndex) & " "
    Msg = Combo1.List(Combo1.ListIndex)
    MsgBox Msg
0
 
LVL 14

Expert Comment

by:ajexpert
ID: 6953213
Modify third line as
    Msg = Msg & Combo1.List(Combo1.ListIndex)
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

Author Comment

by:merlin007
ID: 6953221
Thanks

Merlin007
0
 
LVL 1

Expert Comment

by:sudarshan_shir
ID: 6953223
Dim lListIndex as long
if combo.listINDEX <>-1 then
 lListIndex=combo.itemdata(combo.listindex)
end if
0
 

Author Comment

by:merlin007
ID: 6953255
sorry sudarshan shir, I had awarded the points before your answer came in. I am however using your code.

Thanks everyone
merlin007
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

861 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