+ Reply to Thread
Results 1 to 3 of 3

Deconflicting Combobox Change Events

  1. #1
    Forum Contributor
    Join Date
    11-21-2017
    Location
    USA
    MS-Off Ver
    2016
    Posts
    150

    Cool Deconflicting Combobox Change Events

    The function combobox (CB_FUNC) determines what list the Component combobox (CB_COMP) generates. Therefore, the two are interdependent. Additionally, when the user selects an option from either one of these comboboxes a code generates in the search textbox (TB_SEARCH) . The lists, as well as the code generated, are based off the named range (GEN_CODES). While I got everything as I explained to work, I would like that whenever CB_FUNC and CB_COMP have values displayed, the BLN combobox (CB_BLN) and FLN combobox (CB_FLN) are null, which is where I am struggling.

    The BLN combobox (CB_BLN) and the FLN combobox (CB_FLN) are NOT interdependent. When one has a value displayed the three remaining comboboxs should show a null string. For example, if a user selects an item from CB_BLN then CB_FUNC, CB_COMP, and CB_FLN should all show an empty value. Or if a user selects an item from CB_FLN then CB_FUNC, CB_COMP, and CB_BLN should all show an empty value.

    PROBLEM: The change events for CB_FUNC, CB_COMP, CB_BLN, and CB_FLN appear to create an endless loop (when one changes the others change and this goes back and forth until excel ultimately crashes). I've tried enable events, I've tried various renditions of if, and, or clauses to narrow down exactly what I want to have happen, among many other things. I'm at my wits end. While everything else seems to work the way I explained, this is my one hold up. Your help would be greatly appreciated.

    Note: to show the userform click on cell A11 on the “Points” ws. To see the named ranges go to the “Parts” ws. Thanks again for any help.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373

    Re: Deconflicting Combobox Change Events

    Hi- please see attached

    What I did was added a flag to check to see if the UI was updating before running the code to change the values in the combo boxes to null.

    This way the first combo box change events prevents any other combo box change events from firing their code to null the other combo boxes and creating a infinite loop.

    Once the first change event is finished the UI updating flag is set back to false.

    See if this works for you
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    11-21-2017
    Location
    USA
    MS-Off Ver
    2016
    Posts
    150

    Re: Deconflicting Combobox Change Events

    Thanks Poizhan, that did the trick. I see you created your own window to isolate the change events from firing where then you inserted the code in question. That makes sense. Thanks for showing me.

+ 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/Dropdown change events triggered when Saving As
    By cristinik in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2015, 07:11 AM
  2. Userform Combobox to populate form: Can I change the order of the columns in the combobox?
    By CraigWiggins in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-31-2014, 12:14 PM
  3. Combining object (textbox and combobox) change events
    By abousetta in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-11-2011, 10:44 PM
  4. combobox events and variable setting
    By rokuk in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-27-2007, 08:55 PM
  5. Multiple combobox and change events
    By jbrooxie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-04-2006, 10:20 AM
  6. ComboBox Events Fire Many Times
    By ms in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-04-2006, 08:35 AM
  7. combobox change event is running when enable events is false
    By tysop in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-24-2006, 10:20 AM

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