Label Caption in VBA 
Author Message
 Label Caption in VBA

Hi,

I'm having difficulty in determining the correct code to
access/change the caption of a label which resides on a
report. I'm doing this from VBA and have tried all sorts
of ways to no avail.

Is it Labelname.something.Caption?

Thanks for your help.



Fri, 28 Oct 2005 14:58:05 GMT  
 Label Caption in VBA
Just LabelName.Caption. For example ...

Private Sub Report_Open(Cancel As Integer)

    Label0.Caption = "This is a test caption"

End Sub

If you continue to have problems - what event procedure are you running your
code from?

--
Brendan Reynolds (Access MVP)


Quote:
> Hi,

> I'm having difficulty in determining the correct code to
> access/change the caption of a label which resides on a
> report. I'm doing this from VBA and have tried all sorts
> of ways to no avail.

> Is it Labelname.something.Caption?

> Thanks for your help.



Fri, 28 Oct 2005 19:40:44 GMT  
 Label Caption in VBA
I think I've been relying far too much on the auto method
listing. Strange as it may sound, when I use
Me.LabelName. then a list of methods displays however
without 'Caption' as it is not available for selection.
And yet we are still able to use it. Hmmm.

But the main thing is that it works, so many thanks!

Quote:
>-----Original Message-----
>Just LabelName.Caption. For example ...

>Private Sub Report_Open(Cancel As Integer)

>    Label0.Caption = "This is a test caption"

>End Sub

>If you continue to have problems - what event procedure

are you running your
Quote:
>code from?

>--
>Brendan Reynolds (Access MVP)



>> Hi,

>> I'm having difficulty in determining the correct code
to
>> access/change the caption of a label which resides on a
>> report. I'm doing this from VBA and have tried all
sorts
>> of ways to no avail.

>> Is it Labelname.something.Caption?

>> Thanks for your help.

>.



Fri, 28 Oct 2005 20:56:56 GMT  
 Label Caption in VBA
Yes, I've noticed that myself. I'm not sure what the explanation is, but as
you've discovered, it works anyway.

--
Brendan Reynolds (Access MVP)


Quote:
> I think I've been relying far too much on the auto method
> listing. Strange as it may sound, when I use
> Me.LabelName. then a list of methods displays however
> without 'Caption' as it is not available for selection.
> And yet we are still able to use it. Hmmm.

> But the main thing is that it works, so many thanks!

> >-----Original Message-----
> >Just LabelName.Caption. For example ...

> >Private Sub Report_Open(Cancel As Integer)

> >    Label0.Caption = "This is a test caption"

> >End Sub

> >If you continue to have problems - what event procedure
> are you running your
> >code from?

> >--
> >Brendan Reynolds (Access MVP)



> >> Hi,

> >> I'm having difficulty in determining the correct code
> to
> >> access/change the caption of a label which resides on a
> >> report. I'm doing this from VBA and have tried all
> sorts
> >> of ways to no avail.

> >> Is it Labelname.something.Caption?

> >> Thanks for your help.

> >.



Sat, 29 Oct 2005 02:44:52 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Label.Caption too big for Label.Width

2. Permanently change a text label's caption?

3. How to get label captions from an array...?

4. Auto label/Caption change

5. Changing the caption property on a label at run time

6. Label Caption Change

7. Linebreak in label control caption

8. Changing label captions: how to refresh

9. Labels Captions permanent modification

10. Captions of Labels

11. Change label caption in userform on change of dropdown listbox

12. Howto force linebreak in label control caption

 

 
Powered by phpBB® Forum Software