Find Name of Textbox (1 Viewer)

Hdata

Registered User.
Local time
Today, 14:08
Joined
Sep 10, 2013
Messages
56
I'm looking for a way with VBA to find the name of a textbox control after inserting the cursor in that textbox. Possible? Thanks in advance.
 

pr2-eugin

Super Moderator
Local time
Today, 19:08
Joined
Nov 30, 2011
Messages
8,494
Maybe something like..
Code:
MsgBox "The Cursor is in : " & Screen.ActiveControl.Name
 

Hdata

Registered User.
Local time
Today, 14:08
Joined
Sep 10, 2013
Messages
56
Would the information keyword provide the control name of a textbox?
 

TJPoorman

Registered User.
Local time
Today, 12:08
Joined
Jul 23, 2013
Messages
402
You would also need to place this in an event that will fire no matter which textbox you click. The only event I can think of is the Forms On Mouse Down. Though this could pose a problem if the user clicks somewhere other than a textbox.

Just curious, what is your end goal that you are trying to achieve?
 

Users who are viewing this thread

Top Bottom