I came up with a fix. Not sure if it's the best option, but it's reasonably efficient.
I just started learning VBA a few weeks ago, so I'm steadily progressing toward the steep part of my learning curve. I didn't realize there were more events available aside from _Change(). Since _Change() fires when the value property is changed programmatically (and not just when the value is changed using the combo box, an infinite loop was created because when one change event re-writes the other two value properties, their change events fire and re-calculate the other two value properties, and so on. Even though it's calculating the same thing each time (after it runs through once) it's still processing the code. Guess I got too used to Excel's limiting of iterative calculations to a certain amount of change before it fires...
The other issue is that _Change() also fires when you click on the dropdown (before you actually change the value). Doesn't really make sense, especially when there is a DropButtonClick() event; but after thorough searching, it seems there is no way to directly test if the user has given something focus. Combining the _Enter(), _Change() and _Exit() events together in series solved both of these issues by stopping _Change() when it doen't have focus. I have two Public variables (As Boolean) dscStationFocus and dscAuditorFocus to capture focus. Focus is made True only by the _Enter() event and _Change() only runs when Focus is True, and after running it changes it back to False. If the user clicks the drop down but doesn't change the value, the _Exit() event changes the Focus back to False.
This works great, but if someone knows how to directly test for focus, I'd like to know. Below is the first code changed to incorporate the 3 events. (and I also converted all of my variables to Hungarian style notation)
Bookmarks