Solved

combo box

Posted on 2002-06-19
2
188 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

828 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