How get label attached to a textbox?

M

mscertified

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.
 
B

Brendan Reynolds

Private Sub Text0_DblClick(Cancel As Integer)

MsgBox Me.Text0.Controls(0).Name

End Sub

Where 'Text0' is the name of your textbox.
 
T

TC

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top