PC Review


Reply
Thread Tools Rate Thread

On Dbl Click event

 
 
FPS, Romney
Guest
Posts: n/a
 
      10th Jul 2009

Hi all,
In Access 97, SR2, the On Dbl Click event for forms produces the same result
as the On Click event. Why is this?

.... I've had to watch where I place buttons which open other forms because
accidental double-clicks on the first form can produce unintentional
"clicks" on the second form as it opens.

Thanks,
Mark


 
Reply With Quote
 
 
 
 
John Spencer
Guest
Posts: n/a
 
      10th Jul 2009

Actually, if you have a click event it will always be implemented and
any double click event will probably never be implemented.

You might try using only double click events - move your click event
code to the double click event - but that is counter to the normal
interface.

I guess you could open the other forms with all the controls locked and
have a timer event run after 500 milliseconds that would unlock all the
controls and set the timer interval to zero (so the event would not be
continually running).

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================


FPS, Romney wrote:
> Hi all,
> In Access 97, SR2, the On Dbl Click event for forms produces the same result
> as the On Click event. Why is this?
>
> ... I've had to watch where I place buttons which open other forms because
> accidental double-clicks on the first form can produce unintentional
> "clicks" on the second form as it opens.
>
> Thanks,
> Mark
>
>

 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      10th Jul 2009

"FPS, Romney" wrote in message
news:e%(E-Mail Removed)...
> Hi all,
> In Access 97, SR2, the On Dbl Click event for forms produces the same
> result
> as the On Click event. Why is this?


I'm not sure what you mean, but double-clicking a control causes both the
Click and DblClick events to fire. If the control is a command button, the
Click event then fires a *second* time, after the DblClick event. This is
all, as they say, "by design", and documented in the help file. This makes
it difficult to use both the Click and the DblClick event of a control, and
I make it a policy not to do that.

> ... I've had to watch where I place buttons which open other forms because
> accidental double-clicks on the first form can produce unintentional
> "clicks" on the second form as it opens.


I can see how that could be an issue, if you or your users are habitual
double-clickers, though I haven't run into it myself.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Reply With Quote
 
Jack Leach
Guest
Posts: n/a
 
      10th Jul 2009

On my switchboard I have a left side panel that contains "buttons" for
opening various standard forms. These aren't command buttons, but instead
image files with events on the double click procedures of the image (two
images for each "button" - the normal and the active with a yellow orangish
tinge which is easily enough accomplished via a decent image editor).

This works nice because is keeps the users from accidentally opening a form
(single clicks are pretty easy to accidentally land anywhere, especially when
trying to bring the buried switchboard form to the top), and you can get some
fancy graphics for your "buttons".

This may be of some consideration if you would like to make sure users
aren't accidentally running commands (I don't go so far as to get the
depression effect of a clicked button on my images, but playing around with
some graphics and maybe even the onmouseover event you could probably
simulate the effect fairly accurately).

Bottom line, if you don't want a double click rather than click, don't use a
command button. If you want just one click, use a command button.

hth
--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)



"FPS, Romney" wrote:

> Hi all,
> In Access 97, SR2, the On Dbl Click event for forms produces the same result
> as the On Click event. Why is this?
>
> .... I've had to watch where I place buttons which open other forms because
> accidental double-clicks on the first form can produce unintentional
> "clicks" on the second form as it opens.
>
> Thanks,
> Mark
>
>
>

 
Reply With Quote
 
vanderghast
Guest
Posts: n/a
 
      10th Jul 2009
On some Operating System, you have the possibility to have the single click
to behave as a double click (to help people having fine motricity problem).
Maybe that setting is set, if you find that the system seems to over-react
as if you did two single-clicks when your intention is to use a single
double-click.

Can be something else, though. It is just one among multiple possibilities.


Vandergahst, Access MVP

"FPS, Romney" <(E-Mail Removed)> wrote in message
news:e%(E-Mail Removed)...
> Hi all,
> In Access 97, SR2, the On Dbl Click event for forms produces the same
> result
> as the On Click event. Why is this?
>
> ... I've had to watch where I place buttons which open other forms because
> accidental double-clicks on the first form can produce unintentional
> "clicks" on the second form as it opens.
>
> Thanks,
> Mark
>
>


 
Reply With Quote
 
FPS, Romney
Guest
Posts: n/a
 
      10th Jul 2009

Thanks all for the responses.
I've moved the buttons on one of the second forms out of the way in case of
dbl-clicks.
On another form, however, is a fairly large calendar and darn if that second
click doesn't land right on the part of the calendar that advances to the
next month. I guess I'll just let people learn not to dbl-click when they go
to open this form from the main switchboard.
Thanks again,
Mark

"FPS, Romney" <(E-Mail Removed)> wrote in message
news:e%(E-Mail Removed)...
> Hi all,
> In Access 97, SR2, the On Dbl Click event for forms produces the same

result
> as the On Click event. Why is this?
>
> ... I've had to watch where I place buttons which open other forms because
> accidental double-clicks on the first form can produce unintentional
> "clicks" on the second form as it opens.
>
> Thanks,
> Mark
>
>



 
Reply With Quote
 
FPS, Romney
Guest
Posts: n/a
 
      10th Jul 2009
Thanks, Jim ... I tried that but it makes no difference: if I dbl-click the
command button the second form opens and then the second click gets applied
to the position of the cursor.

I tried having the On Click event of the command button open the second form
(as is normal) and then placed a msgbox in the On Dbl Click event of that
same button. When I double click the button, the second form opens, but the
message never displays.

"JimBurke via AccessMonster.com" <u49905@uwe> wrote in message
news:98df8bbebd25b@uwe...
> If you're having trouble with certain buttons, I think you can just

duplicate
> the on Click code in the On Double Click event proc - I think that way it
> will capture the double click, while still allowing them to single click.

A
> bit of a pain to have to do that, but I think it will prevent the problem

of
> the click being used on the opened form. Try it with one of the offending
> buttons and see what happens - don't know for sure if that will work but

it's
> worth a try.
>
> FPS, Romney wrote:
> >Hi all,
> >In Access 97, SR2, the On Dbl Click event for forms produces the same

result
> >as the On Click event. Why is this?
> >
> >... I've had to watch where I place buttons which open other forms

because
> >accidental double-clicks on the first form can produce unintentional
> >"clicks" on the second form as it opens.
> >
> >Thanks,
> >Mark

>
> --
> Jim Burke
>
> Message posted via http://www.accessmonster.com
>



 
Reply With Quote
 
Mark
Guest
Posts: n/a
 
      11th Jul 2009
Thanks, Jim.
I'm having trouble understanding the flow of events in your suggestion, but
I'll work on it. The problem doesn't occur that often -- most users learn to
be careful with their clicks. Laptops with sensitive touch pads seem most
prone to this kind of problem, but they're more prone to inadvertent clicks,
even single clicks, anyway.

It does seem that Access will simply ignore the Dbl Click event if there's
also a Single Click event for that command button AND the Single Click event
involves opening a form -- even just a msgbox.

If the Single Click event involves setting the value of Textbox-1 and the
Dbl Click event involves setting the value of Textbox-2, then
single-clicking the command button results in the setting of Textbox-1 (as
intended). Double-clicking, however, results in not only setting the value
of Textbox-2 (with its dbl-click value), but also setting the value of
Textbox-1 with its single-click value.

Mark

"JimBurke via AccessMonster.com" <u49905@uwe> wrote in message
news:98e2ac7000684@uwe...
> Oh well, worth a try anyway. Seems kind of odd that they'll let you do one

or
> the other, but not both. Other applications can obviously handle it, not

sure
> why Access can't. Maybe there's a way to detect that a click was done when
> you open the form and ignore it?
>
> One thing you could do, if this is a real pain for your users. If you're
> willing to have the very first click of the 'offending' button ignored in

the
> cases where your user didn't double click form the previous form, you

could
> set a module-level boolean variable in the form that opens up in it's open
> event, say it's called firstClick. Set it to true there. Then on the

button's
> On Click event, put this at the very beginning:
>
> If firstClick then
> firstClick = false
> exit sub
> end if
>
>
> FPS, Romney wrote:
> >Thanks, Jim ... I tried that but it makes no difference: if I dbl-click

the
> >command button the second form opens and then the second click gets

applied
> >to the position of the cursor.
> >
> >I tried having the On Click event of the command button open the second

form
> >(as is normal) and then placed a msgbox in the On Dbl Click event of that
> >same button. When I double click the button, the second form opens, but

the
> >message never displays.
> >
> >> If you're having trouble with certain buttons, I think you can just

duplicate
> >> the on Click code in the On Double Click event proc - I think that way

it
> >[quoted text clipped - 14 lines]
> >> >Thanks,
> >> >Mark

>
> --
> Jim Burke
>
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...dules/200907/1
>



 
Reply With Quote
 
Mark
Guest
Posts: n/a
 
      11th Jul 2009
Yes, I see what's happening now. Thank you, Jim, for the suggestion and the
clarification.
Mark

"JimBurke via AccessMonster.com" <u49905@uwe> wrote in message
news:98ea34907e53a@uwe...
> Just to clarify my crazy suggestion:
>
> 1) at the top of the code module of the form that is opened when the

button
> is clicked:
>
> Dim firstClick as Boolean
>
> 2) in that same form's Open event proc:
>
> firstClick = True
>
> 3) again on that form, in the event proc of the control that sometimes

gets
> activated by the double-click:
>
> If firstClick then
> firstClick = false
> exit sub
> end if
>
> Put that at the very beginning of the control's click event proc. this way
> the very first time that on click event is triggered it will be ignored.

If
> it's triggered by the double-click from the previous menu, then the

variable
> is reset, nothing happens, and the first click on the control by the user
> will work fine. If it wasn't triggered by a double-click from the previous
> menu, then the user will just think the click didn't take and they'll have

to
> click a 2nd time. after that the variable is set to false and it's ignored

as
> long as the form remains open.
>
> Mark wrote:
> >Thanks, Jim.
> >I'm having trouble understanding the flow of events in your suggestion,

but
> >I'll work on it. The problem doesn't occur that often -- most users learn

to
> >be careful with their clicks. Laptops with sensitive touch pads seem most
> >prone to this kind of problem, but they're more prone to inadvertent

clicks,
> >even single clicks, anyway.
> >
> >It does seem that Access will simply ignore the Dbl Click event if

there's
> >also a Single Click event for that command button AND the Single Click

event
> >involves opening a form -- even just a msgbox.
> >
> >If the Single Click event involves setting the value of Textbox-1 and the
> >Dbl Click event involves setting the value of Textbox-2, then
> >single-clicking the command button results in the setting of Textbox-1

(as
> >intended). Double-clicking, however, results in not only setting the

value
> >of Textbox-2 (with its dbl-click value), but also setting the value of
> >Textbox-1 with its single-click value.
> >
> >Mark
> >
> >> Oh well, worth a try anyway. Seems kind of odd that they'll let you do

one or
> >> the other, but not both. Other applications can obviously handle it,

not sure
> >[quoted text clipped - 27 lines]
> >> >> >Thanks,
> >> >> >Mark

>
> --
> Jim Burke
>
> Message posted via http://www.accessmonster.com
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When user press F5 after a button click event, the click event fires again! Max2006 Microsoft ASP .NET 2 19th Sep 2007 06:37 AM
How to raise an event of button (click event) from textbox's onkeydown event? ABC Microsoft Dot NET Framework Forms 2 25th Jul 2006 11:19 AM
Wire up a click event within another click event doesn't work... Chu Microsoft ASP .NET 2 10th Apr 2006 11:43 PM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge Microsoft ASP .NET 2 26th May 2004 12:45 AM
How to block itemcheck event when i double click in a listView (not click on the checkbox) Bright Sun Microsoft C# .NET 0 28th Jan 2004 04:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:03 AM.