View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Stephen Newman[_2_] Stephen Newman[_2_] is offline
external usenet poster
 
Posts: 18
Default 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