Name of control by double clicking control

Cosmos75

Registered User.
Local time
Today, 06:28
Joined
Apr 22, 2002
Messages
1,280
Is there a way to show name of a control by double-clicking it? Say I have a textbox names txt1, instead of have to do this for each control I have in a form
Code:
Private Sub txt1_DblClick(Cancel As Integer)

MsgBox  "txt1"

End Sub
Is there some other command to do this?
:confused:
 
You can create a general function to call on double click:

Public Function ShowName()

MsgBox Me.Name, vbOKOnly

End Function

In the On Dbl Click property put ShowName()

GumbyD
 
Found it!:)

'Name of control
Me.ActiveControl.Name


So I can use

MsgBox Me.ActiveControl.Name
 

Users who are viewing this thread

Back
Top Bottom