Command Button Double-Click

Command Button Double-Click

We have users who routinely double-click on the command buttons. What is the best way to ensure that the code is only fired once?

One approach would be to set the button’s Enabled property to False in your Click code. This should work most of the time, but you may also want to set a flag in the Click event to indicate that the button was already pressed. If the flag is True after that, which it would be from another click, exit the routine. Be sure to clear the flag for when the user can click the button again.


Share the Post: