Solved

how to read the itemdata of a selected item in combo

Posted on 2002-04-19
6
272 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now