+ Reply to Thread
Results 1 to 6 of 6

ComboBox.Clear ...displayed values in the ComboBox dissappear

  1. #1
    Forum Contributor
    Join Date
    05-12-2008
    Location
    Schleswig-Holstein, Germany
    MS-Off Ver
    2010
    Posts
    102

    ComboBox.Clear ...displayed values in the ComboBox dissappear

    Hi everybody,

    ...facing again an new issue... I hope you can help me out...


    I´m using two methods to clear both Combo boxes and text fields....

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    ...and it "works out"...but not that good...

    When I hit the "reset" button on my form, both Combos and Text Fields are set to blank. But if I want to display again (a second time) the different options under the Combos, their selection lists are blank, empty as well...what am I doing wrong?

    Thanks in advance for any help/hints

    25.05.png

    25.05b.png

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,912

    Re: ComboBox.Clear ...displayed values in the ComboBox dissappear

    If you clear a combobox, you clear its list entries, not simply the selection. To clear the selection, set the Listindex to -1.

  3. #3
    Forum Contributor
    Join Date
    05-12-2008
    Location
    Schleswig-Holstein, Germany
    MS-Off Ver
    2010
    Posts
    102

    Re: ComboBox.Clear ...displayed values in the ComboBox dissappear

    Thanks rorya,

    It´s a step further. i have modified the code like this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Unfortunately, this has a second unwanted effect. My ComboBoxes are dependent on each other...And now it happens that the second "child" Combo can display entries independiently from the Combo "parent". In the screenshot below, the Combo parent displays no entries, but the Com child displays independiently a set of values assigned to the first entry in the Combo parents...this shouldnt happen, since the first entry in the Combo parent was not previously selected:

    25.05c.png

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: ComboBox.Clear ...displayed values in the ComboBox dissappear

    What code are you using to populate the dependent comboboxes?
    If posting code please use code tags, see here.

  5. #5
    Forum Contributor
    Join Date
    05-12-2008
    Location
    Schleswig-Holstein, Germany
    MS-Off Ver
    2010
    Posts
    102

    Re: ComboBox.Clear ...displayed values in the ComboBox dissappear

    I have adapted the code from this tutorial...

    http://www.excel-easy.com/vba/exampl...mbo-boxes.html

    I forgot to mention that the set of entries displayed in the screenshot above, are those corresponding to the entry in Combo1 which last time was selected Combo parent just before making the reset.

  6. #6
    Forum Contributor
    Join Date
    05-12-2008
    Location
    Schleswig-Holstein, Germany
    MS-Off Ver
    2010
    Posts
    102

    Re: ComboBox.Clear ...displayed values in the ComboBox dissappear

    Problem solved...the issue had to to with other part of the code (With Statements)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. ComboBox values source being changed based on another combobox selection in a UserForm
    By stephenanderson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-08-2016, 11:12 PM
  2. [SOLVED] 3rd combobox based on values of combobox 1 and 2
    By MyComputerGuy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-30-2015, 02:54 AM
  3. [SOLVED] Userform combobox to populate RowSource for new values in combobox
    By Stratfordoaks in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-17-2013, 01:18 PM
  4. Styles from Activeworkbook need to be displayed on ribbox comboBox
    By srinivas1104 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-18-2011, 07:13 AM
  5. Replies: 2
    Last Post: 09-14-2009, 08:34 AM
  6. Combobox Displayed search
    By D_Rennie in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 06-19-2009, 02:37 AM
  7. Embed combobox and look up values based on combobox value
    By cutie4032 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-16-2008, 01:11 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1