Joe Rojas
JRojas at tnco-inc.com
Mon Jul 7 12:11:09 CDT 2003
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.