I have some VBA code that is behind two activex comboboxs, and I have some code behind four activex buttons. All my code works just fine, but at certain places in the code, other code runs in between this code. It's very frustrating, because they are firing when they're not being called.
I wanted them to fire only when they are called. I have tried to prevent this by creating a global public variable called jcDisabledEvents and declared it as Boolean. This is the way that my code is setup.
The code below is placed in the subroutine that are misfiring.
While debugging the VBA code, I figured out where the code is firing without being called, and I have entered the lines of code below in each of the subroutines where the misfiring is taking place.
After entering this code, it stops my code that is misfiring from working when it is called.
This is driving me nuts.
If anyone can help please do and fast!!!
I wanted them to fire only when they are called. I have tried to prevent this by creating a global public variable called jcDisabledEvents and declared it as Boolean. This is the way that my code is setup.
Code:
Public jcDisabledEvents As Boolean
The code below is placed in the subroutine that are misfiring.
Code:
If jcDisabledEvents = True Then Exit Sub
While debugging the VBA code, I figured out where the code is firing without being called, and I have entered the lines of code below in each of the subroutines where the misfiring is taking place.
Code:
jcDisabledEvents = True 'turn code off
code....
jcDisabledEvents = False 'turn code back on
After entering this code, it stops my code that is misfiring from working when it is called.
This is driving me nuts.
If anyone can help please do and fast!!!