Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force new line in a text box using code 1

Status
Not open for further replies.

HeyYouItsMe

Technical User
Feb 1, 2001
2
US
I would like to fill a single text box with multiple lines of information on a report using code. I can do this but am unable to force a new line so that the information is easier to read. The effect I am trying to achieve is possible when the information is entered directly into the control source of a text box and pressing <Ctrl+Enter> to start a new line. This same effect can be done in a field in a table. This would seem to indicate the effect can be achieved using code but so far I have not discovered the way.

I have tried using &quot;Chr(10) &amp; Chr(13)&quot; when concatenating the message but this does not work.

Any help would be appreciated.

Thanks
 
try using the built in constant vbCrLf instead of the chr(?). I beleive that you got them reversed but why worry about it if you can use the constant.
 
The constant worked and it turns out that the order of the &quot;Chr(13) &amp; Chr(10)&quot; was my problem all along. Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top