double click cmd button on subform

  • Thread starter Thread starter ajw via AccessMonster.com
  • Start date Start date
A

ajw via AccessMonster.com

I have a subform on a main form that has a command button that I wanted to
use a single click as well as a double click event. I have VBA code for
both the click event and double-click events. When I try to double click
the command button, I always go to the click event. Is this a limitation
of a command button, a sub-form, or am I doing something wrong with trying
to use a double click event with a command button?
Thanks for any help
 
Well I was curious so I set up a simple test on a simple form and you're
right - it doesn't work. Here's what the Help (Access 2002) has to say:

"The second click may have no effect (for example, if the Click macro or
event procedure opens a modal dialog box in response to the first Click
event). To prevent the second Click macro or event procedure from running,
put a CancelEvent action in the DblClick macro or use the Cancel argument in
the DblClick event procedure. Note that, generally speaking, double-clicking
a command button should be discouraged."

Clear as mud right? FWIW, I tried using the Cancelevent and it still doesn't
work. Regardless, I still would agree with their last point -
"double-clicking a command button should be discouraged." I think it makes
for a confusing UI - command buttons should be activated by a single click.
 
Thanks for the response.
I had an update button that would update the single current record, but
have a need to update all the same type records. I just thought that
having one button handle both would be neater, but it probably would be
more confusing using a single click and double-click than to just add the
second command button.
thanks again for your help
 
Back
Top