M
MikeB
If I code "Me.Name" in a VBA module, I can get the name of the form.
Is there a generic way that I can write some code to interrogate
something to get the name of the current control? I guess that would
be the control that has focus? So perhaps a collection of controls on
the form and then then iterate through those until I get one that has
"HasFocus = True?" and then what?
I want to write an event handler for a control and I want it to
pass the name of the control to a function or perhaps have the
function figure out the name of the control and the name of the event
handler that called it?
Reason is I'm writing a test form with a few controls to figure out
when each event is invoked and I'm doing a bunch of repetitive coding
that I'm looking to shortcut.
Thanks.
Is there a generic way that I can write some code to interrogate
something to get the name of the current control? I guess that would
be the control that has focus? So perhaps a collection of controls on
the form and then then iterate through those until I get one that has
"HasFocus = True?" and then what?
I want to write an event handler for a control and I want it to
pass the name of the control to a function or perhaps have the
function figure out the name of the control and the name of the event
handler that called it?
Reason is I'm writing a test form with a few controls to figure out
when each event is invoked and I'm doing a bunch of repetitive coding
that I'm looking to shortcut.
Thanks.