
Detecting which control raised an event
Quote:
> Hi,
> I have a large number of text boxes that all share the same lostFocus
> event to run the same sub routine. This is working fine....but how do
> I get the name of the control that raised then event?
> Thnx,
> Stu
In the event handler, you have the sender object. It has to be cast to a
TextBox:
MsgBox("Name of form is: " & CType(sender,TextBox).Name)
Alternately, you can use the Tag property and use the same cast to get the
tag.
Chris
--
If you don't like lunchmeat, please remove it from my e-mail address to
send me an e-mail