Results 1 to 2 of 2

Thread: [RESOLVED] Combobox

  1. #1

    Thread Starter
    Addicted Member Fonty's Avatar
    Join Date
    May 2006
    Location
    New York
    Posts
    173

    Resolved [RESOLVED] Combobox

    Suppose you have a userform. Once you added n items to a combobox, the user is supposed to select one of the n items.
    Then you save the value as:
    combovalue = cboRightValues.Value
    But the user can write something in the combobox case by mistake or laziness.
    How can you write something like:
    If combovalue doesn't belong to the n items collection of cboRightValues Then
    MsgBox "Try again"
    Exit Sub
    End if
    Last edited by Fonty; May 22nd, 2007 at 01:17 PM.

  2. #2
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: Combobox

    You do know you can change the Style property to "Dropdown List", which means that the user can only select from the list...
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width