Solved

Ignore double click carried over from previous form

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

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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 50

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 50

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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…

679 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