# Using Chr(13) in TextBox (VB)



## asbo (Sep 21, 2001)

The code should explain itself, but what I'm trying to do is get numbers out of 4 other textboxes, string them together into one big one, and display on their own line. Now, when I use the code below, I get the weird little character representing something the font cannot display. What is happening? Shouldn't the & Chr(13) & command work in TextBoxes? And BTW, multi-line IS set to on.


```
Private Sub Command1_Click()
    Dim abcd, flwr1, flwr2, flwr3, flwr4 As String
    
    flwr1 = Text1.Text
    flwr2 = Text2.Text
    flwr3 = Text3.Text
    flwr4 = Text4.Text
    
    abcd = "Flower #1: " & flwr1 & "" & Chr(13) & _
           "Flower #2: " & flwr2 & "" & Chr(13) & _
           "Flower #3: " & flwr3 & "" & Chr(13) & _
           "Flower #4: " & flwr4 & "" & Chr(13) & ""
           
    Text6.Text = abcd
End Sub
```
Thanks


----------



## IMM (Feb 1, 2002)

You might be looking for Chr$(13) ??

There are always the predefined constants?
Q178769 - XL98: Using VbConstants in Text Strings in MS Excel 98
http://support.microsoft.com/support/kb/articles/Q178/7/69.ASP

or perhaps the whole thing CR + LF ?
nl = Chr$(13) + Chr$(10) ' New-line.


----------



## DJ [email protected] (Aug 8, 2001)

Chr(13) wont work on its own, it must be

```
abcd = "Flower #1: " & flwr1 & "" & Chr(13) & Chr(10) & _
```
Chr(13) is the carraige return but you also need Chr(10) which is the new line feed. alternativly, you could do this

```
abcd = "Flower #1: " & flwr1 & "" & vbNewLine & _
```
good luck


----------



## asbo (Sep 21, 2001)

Ah! Got to me too soon! 

I just found a page explaning that, yes, you need both CR & LF to make a new line... Maybe I should look harder next time! 

Thanks again guys!

BTW, for anyone who cares, the site is http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconworkingwithtextbox.asp.

It's a biggie


----------

