Reference Label from TextBox
On Sun, 20 Jul 2008 18:15:38 +0100, "Peter T" <peter_t@discussions
wrote:
Yes, it works now. I'd left out the textbox number when I tried.
Thanks very much for your help.
"Peter T" <peter_t@discussions wrote in message
Your routine SetLabel is called by the keypress event of a textbox on a
form. Surely the form containing the textbox is the "currently active
UserForm". That being the case txtBox.Parent will reference the form.
....unless the textbox is "in" a frame or multipage in which case you'd use
txtBox.Parent.Parent
or if on a Multipage then you'd use
txtBox.Parent.Parent.Parent
Regards,
Peter T
|