Results 1 to 2 of 2

Thread: Combobox (2002)

  1. #1
    New Lounger
    Join Date
    May 2005
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combobox (2002)

    Is there a way to target a combobox on a userform?

    Let's assume that in combobox 1 value was not chosen, can a macro be set to target this combobox?

    Any help is greatly appreciated. Thanks in advance.

    Aloys

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combobox (2002)

    Say you have a command button cmdOK on the form. In the On Click event procedure, you can test the combo box:

    Private Sub cmdOK_Click()
    If Me.ComboBox1 = "" Then
    MsgBox "Please select an item from ComboBox1.", vbExclamation
    Me.ComboBox1.SetFocus
    Exit Sub
    End If
    ' Code to execute otherwise
    ...
    End Sub

Posting Permissions

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