Solved

Ignore double click carried over from previous form

Posted on 2015-02-16
7
107 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
[X]
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
  • 3
  • 3
7 Comments
 
LVL 85
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 51

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 51

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 51

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

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…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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…
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…

632 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