ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Returning active control name on multipage (https://www.excelbanter.com/excel-programming/378401-re-returning-active-control-name-multipage.html)

Jim Cone

Returning active control name on multipage
 
Ryan,
'This works with a command button on a userform, it does not work with a label...
Private Sub CommandButton1_Click()
MsgBox Me.ActiveControl.Name
End Sub

'This passes the label name to the called procedure...
Private Sub LabelOne_Click()
Call ThisIsATest("LabelOne")
End Sub

Sub ThisIsATest(strName As String)
MsgBox strName
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Hokievandal"

wrote in message
When i click a lablel, i want to pass the label name onto a procedure but I
can't figure out how to recognize the active control's name (is a label the
active control if it has been clicked?). Here's the code after the label has
been clicked that does not return any value (just an error).

Me.Multipage.SelectedItem.ActiveControl.Name
Thanks,
Ryan




All times are GMT +1. The time now is 11:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com