Running a label double click event

aziz rasul

Active member
Local time
Today, 18:35
Joined
Jun 26, 2000
Messages
1,935
How do I run a label double click event via a command button? I have tried

Code:
Call Forms("frmTrimData").lblTableName_DblClick

but I error 'Argument not optional'.
 
How do I run a label double click event via a command button?

When I wish to hook several events all to the same worker code, I put in the control events a forward to a shared form event. That shared event must be Public, then each control event may call that one shared public form event.

Example:

Code:
'Quotes Specific Functionality
Private Sub btnQuotes_Click()

  Call Me.Quotes_Click

End Sub

[B]Public Sub Quotes_Click()[/B]
  On Error GoTo Err_Quotes_Click

  'See if the FE temp table has the correct records already cached
  If ObjQuotesTbl.FETempTableContentsID = ObjPartsTbl.id Then
    'Skip some steps...
  Else
    'Reset the Quotes object
    Call ObjQuotesTbl.Clear
    
    'Set the PartID we are interested in quotes for...
    ObjQuotesTbl.partid = ObjPartsTbl.id

    'Indicate that the FE Temp Table needs to be refreshed
    ObjQuotesTbl.RefreshFETempTable = True
  End If

  'Prepare the quotes form
  Call modquotes_bootstrap_quotesinit(Me)

  'Open the quotes window via its class
  flgInitArchitecture = True
  Set frmquotes = New Form_quotes
  frmquotes.Visible = True

Exit_Quotes_Click:
  Exit Sub

Err_Quotes_Click:
  Call errorhandler_MsgBox("Form: " & TypeName(Me) & ", Subroutine: Quotes_Click()")
  Resume Exit_Quotes_Click

End Sub

Private Sub fldquotespoprice_DblClick(Cancel As Integer)

  Call Me.Quotes_Click

End Sub

Private Sub fldquoteslttool_DblClick(Cancel As Integer)

  Call Me.Quotes_Click

End Sub

Private Sub fldquotesltfa_DblClick(Cancel As Integer)

  Call Me.Quotes_Click

End Sub

Private Sub fldquotesltprod_DblClick(Cancel As Integer)

  Call Me.Quotes_Click

End Sub

Private Sub fldquoteslttotal_DblClick(Cancel As Integer)

  Call Me.Quotes_Click

End Sub
 
The double click event is already Public.
 
The double click event is already Public.

Did I suggest to make the double click event public vs the VBA default of private?

Re-read post #2 for a working solution to your request.
 
Agreed really. But, FWIW (as mentioned elsewhere)
Call Forms("frmTrimData").lblTableName_DblClick(False)

Unless you do want to cancel the event for some reason. :-p
 
Code:
Call Me.lblTableName_DblClick(False)

did the trick. Thanks.
 

Users who are viewing this thread

Back
Top Bottom