Access Control+Enter Revised

  • Thread starter Thread starter katz
  • Start date Start date
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
 
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"
 
Back
Top