Determine ControlName which has just received Focus
Posted on 2003-12-05
mName = Trim(TxtName) 'mName is a memory variable TxtName is a Textbox on a Frame on a Form.
TxtName.BackColor = &HC0C0FF
TxtName.BorderStyle = 1
I have dozens of Textboxes on a Frame; I have lots of redundant code behind each text box. I have gotten rid of the redundant code
by passing in the name of the textbox to a procedure which contains the previous redundant code behind each text box. The redundant
code is now:
Call HighLiteMe(TxtName) 'where Txtname is the textbox.
Is there a way to accomplish the following:
Whenever an object on the frame gets focus, if it is a textbox, do this to the text box. If the program could determine the name of the
Textbox, I would then be able to determine where to send the focus next.