Solved

Ignore double click carried over from previous form

Posted on 2015-02-16
7
98 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
Comment Utility
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
Comment Utility
In the DoubleClick event, put in this code line:

    Cancel = True

/gustav
0
 
LVL 1

Author Comment

by:Bojerne
Comment Utility
Cancel = True does unfortunately not help :) It's probably detected as two double clicks as Scott mentions
0
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.

 
LVL 49

Expert Comment

by:Gustav Brock
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

728 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now