What is the best way to prevent ƒ oDouble Clickingƒ of a button
on a Form?
The discussion ensuing from this question has been very fruitful,
and I've added the solution to my quiver of techniques. Strangely
enough, I have never encountered this problem, possibly because I'm
responsible for the training of most of my users, and it's drilled
into them from the beginning that a button is double-clicked and an
icon is single-clicked. I don't use the popular mouse-overs that
make flat icons look like buttons when the mouse is over them -- if
it's a button, it looks like a button all the time. I believe that
the use by MS and other software vendors of flat icons that get a 3D
frame on MouseOver is the cause of much of the user confusion on
what you doubleclick and what you singleclick -- if it's flat, it
looks like an icon, and icons should doubleclicked. Even users of
mine who have that distinction very firmly in mind sometimes get
confused by the QuickLaunch toolbar in the TaskBar, since
QuickLaunch icons don't look like buttons until you mouse over them.
Yet, they never doubleclick taskbar buttons (because these look like
buttons all the time).
I'm not claiming this is the cause of users doubleclicking in the
original poster's question, just that it's better to use plain old
boring command buttons rather than getting fancy with mouseovers
that make buttons look like icons and will tempt users to
doubleclick.
Another source of unwanted clicks is user impatience. That is, they
click and they see nothing happening, so they click again. The
solution to that is to always respond to any click with an indicator
that something is happening. DoCmd.Hourglass True is the easiest,
but it's often going to be ignored. You could alternatively pop up a
form telling the user that their requested action is being
initiated, but then you have to have some termination event that
will close the form. In the case of opening an Excel spreadsheet,
it's difficult to know what is most appropriate. Detecting that the
Excel app is running is not necessarily going to work, as that can
happen long before Excel is visible, or Excel could already be
running when the user clicks the button. Testing to see if the
requested workbook is open in the instance of Excel is another way,
since you just need to check the title bar text (which includes both
the app and workbook names).
The point is that you can avoid the impatient clicks by judicious
use of immediate feedback telling the user "Yes, I got your click
and something is happening!" What that feedback will be will be will
depend on what you're doing in the OnClick() event of your command
button.