Access Control+Enter Revised

K

katz

Hello!

How can I add a Control+Enter into a control thru code?
For example, "AAA" & chr(13) & "BBB"
I want the control to show AAA
BBB
chr(13) doesn't break the line.
Thanks
Abe
 
R

RoyVidar

katz said:
Hello!

How can I add a Control+Enter into a control thru code?
For example, "AAA" & chr(13) & "BBB"
I want the control to show AAA
BBB
chr(13) doesn't break the line.
Thanks
Abe

AS the others have suggested, you need both carriage return and line
feed, in that order, for a linebreak to show in a text control.

In code, you can use either some of the constants or the Chr function,
while in controlsources, you need to use the Chr function.

Me!txtTest.value = "AAA" & chr$(13) & chr$(10) & "BBB"
Me!txtTest.value = "AAA" & vbCr & vbLf & "BBB"
Me!txtTest.value = "AAA" & vbCrLf & "BBB"
Me!txtTest.value = "AAA" & vbNewLine & "BBB"
 

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