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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vbCR or Chr(10) and Chr(13) Make Boxes 1

Status
Not open for further replies.

jhaganjr

IS-IT--Management
Dec 11, 2002
62
US
I'm creating text in code and feeding it to text boxes on forms. For example, taking name and address fields and creating an address block in one text box on a form.

To get line feeds I use the vbCr, but it shows up as boxes (character indicators) in the text box instead of executing the carriage return. Same for Chr(10) and Chr(13). The boxes must be deleted by the user and the Ctrl Enter put in manually.

vbCr works when creating text for message boxes or for creating a pure text file use, e-mail for example, but I have the problem when putting text into a text box on a form as described.

Anybody know how to handle this?

Thanks!
 
Hi!

In code you can use vbCrLf (or vbCr & vbLf - need both) can be used.

In the control source, you need to use the chr() thingies (also both):

[tt]="test" & chr(13) & chr(10) & "more test"[/tt]

- does it work?

Roy-Vidar
 
I think it is supposed to be Chr 13 (CR), then Chr 10 (LF). Have you tried both ways?



Ascii dumb question, get a dumb Ansi
 
The vbCrLf seems to be the trick. Thanks.

I didn't try changing the order of the Chr's.

Thanks much!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top