[AccessD] Label Double-Click event fires two times in a row

Stephen Bond stephen at bondsoftware.co.nz
Tue Jul 8 04:24:36 CDT 2003


Joe, I'm not sure I understand the question, but could this excerpt be an answer?  it is from MSAccess Help, the Dbl-Click event:

"If the DblClick event doesn't occur within the double-click time limit of the system, the form, form section, or control recognizes two Click events instead of a single DblClick event. The double-click time limit depends on the setting under Double-Click Speed on the Buttons tab of the Mouse option of Windows Control Panel."

Stephen Bond


-----Original Message-----
From: Joe Rojas [mailto:JRojas at tnco-inc.com]
Sent: Tuesday, 8 July 2003 5:11 a.m.
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Label Double-Click event fires two times in a row


Hi All,

I have a form that has a label on it that I have assigned both a OnClick and
OnDblClick event.
Both of the events are different and are calling two different subs. Below
is the one for the double-click.
The problem is one double-click on the label causes the bottom sub to run
twice! I can't figure out why.
On the first run everything works out well. Once it reaches the Exit Sub
line, it starts all over!

Anyone have a suggestion?

Public Sub DblClickMe(ByVal iLabelNum As Integer)
On Error GoTo DblClickMe_Err
    
    Dim strHoliday As String
    
    If Not (IsNull(mavDates(iLabelNum))) Then
        Call SelectDay(("lbl" & CStr(iLabelNum)))
        
        mrsHoliday.MoveFirst
        mrsHoliday.Find "[HDate] = " & mdSelect, , adSearchForward
        If Not (mrsHoliday.EOF) Then
            strHoliday = InputBox("Holiday for " & mdSelect, "Add/Edit
Holiday", mrsHoliday![Holiday])
            If Not (strHoliday = "") Then
                mrsHoliday![Holiday] = strHoliday
                mrsHoliday.Update
                Me("lbl" & iLabelNum).Caption = Day(mdSelect) & vbCrLf &
strHoliday
                Me.Repaint
            End If
        Else
            strHoliday = InputBox("Holiday for " & mdSelect, "Add/Edit
Holiday")
            If Not (strHoliday = "") Then
                mrsHoliday.AddNew
                mrsHoliday![HDate] = mdSelect
                mrsHoliday![Holiday] = strHoliday
                mrsHoliday.Update
                Me("lbl" & iLabelNum).Caption = Day(mdSelect) & vbCrLf &
strHoliday
                Me.Repaint
            End If
        End If
    End If


DblClickMe_Exit:
Exit Sub

DblClickMe_Err:
MsgBox Err.Number & vbCrLf & Err.Description
Resume DblClickMe_Exit


End Sub




This electronic transmission is strictly confidential to TNCO, Inc. and
intended solely for the addressee. It may contain information which is
covered by legal, professional, or other privileges. If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy, or take any action in reliance on this
transmission. If you have received this transmission in error, please notify
the sender as soon as possible and destroy this message. While TNCO, Inc.
uses virus protection, the recipient should check this email and any
attachments for the presence of viruses. TNCO, Inc. accepts no liability for
any damage caused by any virus transmitted by this email.
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list