Control Name

D

Dib

Hi,

I have a form that has about 20 check boxes, I need to get the name of each
check box when the check box got the focus, and also is it possible to
change the caption of the Label attached to the check box?
Can someone please advice on how to do that.

Thanks
Dib
 
W

Wayne Morgan

Yes, it is possible to change the caption of the label. You would use the name of the
label in code similar to

Me.lblLabelName.Caption = "New Caption"

You can name the labels in such a way, that you will know which label goes with which
control. By default they are just named Label1, Label2, etc.

To get the name of the control with the focus:

Me.ActiveControl.Name
 
D

Dib

Thanks Wayne
Dib
Wayne Morgan said:
Yes, it is possible to change the caption of the label. You would use the name of the
label in code similar to

Me.lblLabelName.Caption = "New Caption"

You can name the labels in such a way, that you will know which label goes with which
control. By default they are just named Label1, Label2, etc.

To get the name of the control with the focus:

Me.ActiveControl.Name
 

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