How get caption of textbox label in OnClick event?

  • Thread starter Thread starter mscertified
  • Start date Start date
mscertified said:
in the OnClick event for a textbox, can I get the caption of the associated
label?


If the event knows the name of the text box:
Me.textbox.Controls(0).Caption

If you are using a general function for a bunch of text
boxes:
Me.ActiveControl.Controls(0).Caption

I suspect that you should use the Enter event instead of the
Click event so the code will run when users tab to the text
box.
 
Back
Top