Quetion??

P

Paul

Does Access tell the different between a Double-Click and Single-Click? I
want to stop users double-click on a button. What this button does is when
user clcik on it once, it will process the data on a text box and at the end
of the process a pop-up message displaying the result. But some users
double-click on the button as a result the pop-up message did not show up
(actualy it did pop-up in the sense) at the end of the process (ie the
second click of it is to the "ok" button on the message box and close the
message box). I want the user to read the result on the message box. How to
stop the user double-click on the button?
 
R

Rob Parker

Interesting question ...

I've just done some testing (in A97 - but I think it's unlikely to be
version dependent) before responding. And that's why I think it's
interesting!

Superficially, yes, Access does know about both single and double clicks.
For many controls, there are both Click and DblClick events. But I find
that if I have events for both, the Click event captures the first click of
the double-click event, and runs its code. I can't get to the double-click
code. My test code simply opened a message box - and if the message-box's
OK button happened to be located at the same position as the original
button, then the second click would OK it and close it (your situation). A
simple workaround could be to ensure that the form's button won't be in the
same place as the message-box OK button - it might be hard to make this
really bullet-proof, but a combination of form-design and use of auto-centre
(for a non-maximized form) should cope in most cases.

HTH,

Rob
 
M

Mark M

On some of my forms (in continuous form mode), I often allow users to
single-click the field name in the header to sort the records by that field
in ascending order; they can double-click to sort in descending order. The
only problem I can see is if they don't double-click properly (they miss the
Windows double-click timing).

You could put some code in the button's double-click event to do nothing;
then if users double-click the button, nothing will happen.
 
R

Rob Parker

My test example was not suffering from any double-click timing. [Users can,
and probably should, set this via Control Panel to make sure that it always
works for them - eg. if they've got arthritis they'll need to adjust the
timing. But that's a separate issue.]

I thought of putting code in double-click to do nothing (that's why I set up
the test form), but the DblClick event never gets triggered if there's also
a Click event - at least on my system (using A97 under Windows ME).

Have you got anything "devious" in your code?

In a particular app of mine (continuous form), a single click in some fields
opens a separate form, while for all other fields double click does a
different action. But the single-click fields don't respond to
double-clicks (even though they have - well, actually had; I removed in when
it didn't ever get triggered) that event code attached to them).

Rob
 
Top