Solved

combo box

Posted on 2002-06-19
2
196 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month7 days, 1 hour left to enroll

622 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