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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get name of clicked button 1

Status
Not open for further replies.

pharcyder

Programmer
Mar 12, 2002
66
DE
Hello,

how would I get back the name of the button the user clicked on a form ? I know the Sub is named like the button, but I want to use the same code for every button but need the name of the currently clicked button for this.

Is there a possibility to find out what the name of the currently clicked button is (in the own code for that button) ?

Thanks in advance,
Jens
 
Jens,
In the event that is processing the button click, use the code:

Me.ActiveControl.Name

to determine the name of the button.

Cheers,

Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
 
Jens,
Qualifier to my last past. It assumes that the buttons are all on the same form, and that the code is internal to the form. It won't work if the code is external, and held in a global module. If this is the case and you need further help, please advise.
Cheers,

Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
 

Thanks Steve !

That was exactly what I was searching for, the code is
held in the local form.

greetings from Germany,
Jens
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top