UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Recognition Of Difference Double Click And Single Click, Access 2016    
 
   
AccessQuery
post Jul 11 2018, 03:28 AM
Post#1



Posts: 53
Joined: 9-June 18



Hi UtterAccess

Is there any Recognition of difference double click and single click

for the following reason:

I have found this article
https://www.tek-tips.com/viewthread.cfm?qid=990847
a workaround, which utilizes the Form_Timer() event, if you're not already using the timer for something else on that form. Here's a sample:

Option Compare Database
Option Explicit

Private mblnDoubleClicked As Boolean

Private Sub cmdClicks_Click()
Me.TimerInterval = 200 'turn on timer
End Sub

Private Sub cmdClicks_DblClick(Cancel As Integer)
mblnDoubleClicked = True 'set flag
End Sub

Private Sub Form_Timer()
Me.TimerInterval = 0 'turn off timer

If mblnDoubleClicked Then
mblnDoubleClicked = False 'reset flag
MsgBox "Double Clicked"
'run 2-click code...
Else
MsgBox "Single Clicked"
'run 1-click code...
End If
End Sub

But in our case we are using a OnTimer = 1000 in the properties of the form,
in order to update a clock

We have a second form, that does not use ontimer, so I will try there.

But wanted to find out if any other methods exist by members to distinguish in VBA.

We are using the double click to drill down from a crosstab query to a standard form.
And we are now attempting to use the drag/drop method on the same crosstab query to update, when the drop is detected.
http://www.vb123.com.au/201202_ds_drag.htm

Thank you kindly

While the single click
Go to the top of the page
 
ChiliDog
post Aug 10 2018, 02:36 PM
Post#2



Posts: 196
Joined: 9-September 11



just thinking out loud, use a module-level datetime var as a semaphore to assess whether we have a double-click, pseudo code would be something like (this may take some tweaking)

- key point is to alway reset datetime var to some old date, this is how we tell if we're dealing with a second click

on click
CODE
[/code]
    'detect & act on a doubleclick
    '--------------------------------
    
    'if there was a previous click
    if not (mydatevar=#1/1/2000 8am") then
    'and it is recent enough to be considered the first of two clicks
              if (now()-mydatevar) < (whatever interval is deemed a doubleclick) then
    
                        do double-click stuff
    
                        reset datevar to #1/1/2000 8am"
    
                        exit sub
    
              endif
    
    endif
    
    'not a double-click so fall thru          
    
    - set mydatevar=now              'set mydatevar to prepare for next click
    
    - do whatever single-click actions are needed - if any
    
       - key point - any single-click logic must reset datevar to #1/1/2000 8am" when done
    [code]

goal is, if none of the single-click actions fire, then all we've done is set mydatevar, in anticipation of next click
This post has been edited by ChiliDog: Aug 10 2018, 02:46 PM
Go to the top of the page
 
AccessQuery
post Aug 11 2018, 08:07 PM
Post#3



Posts: 53
Joined: 9-June 18



Thank you very kindly for the response.

As soon as I have got something working, I will update.
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    18th October 2018 - 02:04 AM