I have a procedure that runs on a timer on a form in my program. If a user clicks a button on another form at the precise millisecond that the timer event is running, it causes problems. So, I need to either do something within the timer event to prevent any other code from running until it is done, or I need to do something within the button event to check whether the timer event is currently running and wait till it is done. Does anyone know how to do either of those things? What I need is like the opposite of doevents.
My temporary solution is to set hourglass to true while the timer event runs to prevent the user from clicking on anything, but I would rather have a solution that is invisible to the user - the hourglass flashing on and off looks sloppy to me.
I tried CurrentProject.AllModules(myModule).IsLoaded, but that always returns true even when the code within the module isn't running.
I have found a few posts with API code to determine if external processes, like excel, are running, but that doesn't help in this situation. I have also seen the shell and wait posts, but I can't see how that would apply to this situation.
Any ideas?
My temporary solution is to set hourglass to true while the timer event runs to prevent the user from clicking on anything, but I would rather have a solution that is invisible to the user - the hourglass flashing on and off looks sloppy to me.
I tried CurrentProject.AllModules(myModule).IsLoaded, but that always returns true even when the code within the module isn't running.
I have found a few posts with API code to determine if external processes, like excel, are running, but that doesn't help in this situation. I have also seen the shell and wait posts, but I can't see how that would apply to this situation.
Any ideas?