Solved

Ignore double click carried over from previous form

Posted on 2015-02-16
7
102 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server views 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 Access…
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…

776 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