Solved

combo box

Posted on 2002-06-19
2
187 Views
Last Modified: 2010-05-02
hi,

i have a number of questions here about combo box control.

1) how to select the 1st item in the combo box as default?
2) when user has selected one of the items, how do i get the value of the item?


thanks.
0
Comment
Question by:icecool
2 Comments
 
LVL 28

Accepted Solution

by:
AzraSound earned 100 total points
ID: 7094725
1) Combo1.ListIndex = 0
2)
Private Sub Combo1_Click()
    MsgBox Combo1.List(Combo1.ListIndex)
End Sub
0
 
LVL 8

Expert Comment

by:DennisBorg
ID: 7094772
  >1) how to select the 1st item in the combo box as default?

To select the first item in the combo box:

      Combo1.ListIndex = 0




   >2) when user has selected one of the items,
       how do i get the value of the item?

You would use the TEXT property of the combo box. For example:

   MsgBox Combo1.Text


0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MS Access - Capture pressed key onclick 4 33
Adding to a VBA? 6 70
MS Date Picker 64 bit 32 bit issue 12 55
Error when passing an argument to a vb6 that contains  '/' 7 37
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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

809 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