Thanks Dirk. I really wanted the control to be pointing to a Label so
when I clicked on the label it would set a string to include the Name
[quoted text clipped - 16 lines]
If you have any ideas would really be appreciated!
You're right that a label can't receive the focus, so it can't be the
active control. But I'm not entorely clear on what you're trying to
accomplish. Clearly, in an event procedure for the label's Click event
(e.g., "CTRef_Click()"), you know the name of the label that was
clicked. So you can easily hard-code that.
On the other hand, if you're trying to develop a general-purpose routine
to handle the Click event for multiple label, so you're trying to avoid
hard-coding the name, I can't think of any property or object that will
give you that. What you could do is set up a function that would
receive the name as a string parameter, and then set each label's
OnClick event property to a function expression that calls the function
and passes the relevant name.
For example, the function could look like this:
'----- start of code -----
Function SetCCTREFInput(pstrName As String)
Me.CCTREFInput = pstrName
'=====other things
End Function
'----- end of code -----
And then you'd set the CTREF label's OnClick event property (not
creating an event procedure at all) to this:
=SetCCTREFInput("CTREF")
If you have another label named "OTHER", related to another field, you'd
set that label's OnClick property to:
=SetCCTREFInput("OTHER")
As I said, I'm not sure I understand what you're trying to do, but maybe
this workaround will get you there.