Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Ignore double click carried over from previous form

Posted on 2015-02-16
7
104 Views
Last Modified: 2015-02-16
In a A2010 datababase the user click on a subform which lists some products, to open up a detail Window of the product informations. Some users have a habit of double clicking on the subform list, and then the second click is "carried over" to the product detail form - and there it sometimes happens to be right over my "go back" button.. - how can I drop/ignore that second click :)?
0
Comment
Question by:Bojerne
  • 3
  • 3
7 Comments
 
LVL 84
ID: 40611916
That would not be a Double Click, but rather two single clicks. A DoubleClick on the Form/Subform would launch whatever code is in the DoubleClick event, and not the code in the Click event.

User training would be in order, it would seem, or perhaps a confirmation box in the "go back" button.
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 40611919
In the DoubleClick event, put in this code line:

    Cancel = True

/gustav
0
 
LVL 1

Author Comment

by:Bojerne
ID: 40611920
Cancel = True does unfortunately not help :) It's probably detected as two double clicks as Scott mentions
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 49

Expert Comment

by:Gustav Brock
ID: 40611925
OK, then you can run this code:

Have a private variable in the main form Declaration section:

    Private SubFormCalled As Boolean

In the OnActivate of the main form:

    SubFormCalled = False

In the OnClick event:

    If  SubFormCalled = False Then
        ' Your current open subform code.
        SubFormCalled = True
    End If

/gustav
0
 
LVL 1

Author Comment

by:Bojerne
ID: 40611930
If you mean that it should be put in the main forms subform where the click is done (and not in the called detail form) then I've tried that now, and it doesn't Work - I can't see the logic why it should Work either :) - because it would only prevent the detail form from being opened twice - which is not the case :)
0
 
LVL 49

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 40611946
It will prevent the doubleclick from creating the second click.

But Scott is, of course, right: If the user clicks twice slowly and the subform opens in between, there is nothing you can do other than moving the buttons around so they don't hit the back button with the second click.

Perhaps you can disable the backbutton by default. Then enable it from the Timer event on the subform with a delay of, say, 500 ms.

/gustav
0
 
LVL 1

Author Comment

by:Bojerne
ID: 40611979
yes, I was thinking about the timer event - will try it now. The weird thing is that it's what I feel is a normal double click - not a slow one :)
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question