Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call double click event of another control 1

Status
Not open for further replies.

mintjulep

Technical User
Aug 20, 2004
1,552
JP
How do you call the double click event of a control from another procedure?

Code:
Private Sub textbox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)

A bunch of statements that work

End
End Sub

Private Sub Button1_Click()

If checkbox1.Value = -1 Then Call textbox1_DblClick()

End Sub

If I try

Call textbox1_DblClick

I get "Argument not optional"

If I try

Call textbox1_DblClick (0)

or

Call textbox1_DblClick (false)

or

Call textbox1_DblClick (true)

I get "type mismatch"

What does it want?
 
Try the following:
Code:
Private Sub CommandButton1_Click()
Dim Cancel As MSForms.ReturnBoolean
   
   If CheckBox1.Value = -1 Then Call TextBox1_DblClick(Cancel)
End Sub
Just don't try to use Cancel in the CommandButton handler or change its value in the TextBox DoubleClick handler. Both produced errors.


Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top