How get label attached to a textbox?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a calendar utility that can display a title.
My form has several date fields and when a user double clicks on a date
textbox my calendar pops up.
I'd like the title to be the label attached to the date box.
How do I do this?

Thanks.
 
Private Sub Text0_DblClick(Cancel As Integer)

MsgBox Me.Text0.Controls(0).Name

End Sub

Where 'Text0' is the name of your textbox.
 
Or: Me.Text0.Controls(0).Caption

OP: .Name gives the name of the label control; eg. "Label0". .Caption
gives the actual text of the label control, eg. "Date of Birth:"

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
Back
Top