Link to home
Start Free TrialLog in
Avatar of Erick37
Erick37Flag for United States of America

asked on

Command1.Enabled = False ??

I have a form with only one Command Button.  When the user clicks the button, I execute a sub which sets Command1.Enabled = False.  Before the sub returns, I re-enable the Command1 button.
Problem:
If the user clicks the button while it is disabled, the sub will execute again upon return.  Why is this? I thought disabling a control prevented the click event from entering the event queue.  Any suggestions?
Avatar of Cardo
Cardo

Have you tried putting a DoEvents in your code before you re-enable the button.  Incase it is queuing things until it gets a chance to process them?

Cardo......
Avatar of Erick37

ASKER

Thanks Cardo, that was the problem.  Submit it as an answer for the points.
Regards, Eric
ASKER CERTIFIED SOLUTION
Avatar of eyaltil
eyaltil

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial