Enter a linefeed in a label via VBA

C

Chuck

I want to enter some text in a label control. The text that goes in the
control requires a line feed or carriage return. How would I do this?

I tried

Me!My_Control.caption = "Text123" & chr(10) & "Text 234"

but that does not work.

Is this possible?

Thanks
 
C

Cheryl Fischer

You need both a CR and an LF:

Me!My_Control.caption = "Text123" & Chr(13) & chr(10) & "Text 234"
 
A

April

Chuck,

A little shorter, you can actually replace the
chr(10) & chr(13)

combination with just:

vbCrLf

April
 

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