Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Clearing comboboxes on cancel (2000)

    I want to clear the combo boxes on a UserForm when I cancel the form. If a combobox STYLE is set to DropDownCombo (allowing user input- as is the case with my bxTitle box), then the code clears just fine. But if the combobox STYLE property is set to DropDownList (allowing only selection from the list -and I have no blanks in the list), then the code fails. Such is the case with my bxAuthors combobox below.
    Perhaps a workaround would be to temporarity set the STYLE property to DropDownCombo, then clear, then reset the property.
    I'd rather not have blanks in the list.
    Any other suggestions?

    <font color=blue>Private Sub btnCancel_Click()

    Me.bxTitle.Text = ""
    Me.bxAuthor.Text = ""
    Me.Hide

    End Sub </font color=blue>

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

    Re: Clearing comboboxes on cancel (2000)

    Simply use

    Me.bxAuthor = ""

    or

    Me.bxAuthor = Null

Posting Permissions

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