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

Putting a new line in a text box 3

Status
Not open for further replies.

adizukerman

IS-IT--Management
Feb 7, 2004
6
US
I have in a table the address broken down into multiple fields
[Address1]
[Address2]
[City]
[State]
[Zip]

I would like to display this in a text box. I have set the text box Control Source property to:
=[Address1] & chr$(13) & [Address2] & chr$(13) & [City] & ", " & [State] & " " & [Zip]

BUT the text book doesn't display a put new lines between Address 1 and Address 2 and City. How do I accomplish this?

Thank you to everyone for taking the time to read this.

- Adi
adizukerman@hotmail.com
 
chr(13) & chr(10)

Need both carriage return and linefeed.

Roy-Vidar
 
Or if you prefer keywords instead:
Code:
=[Address1] & vbcrlf & [Address2] & vbcrlf & [City] & ", " & [State] & " " & [Zip]
 
Thank you for the feedback. I could get chr$(13) & chr$(10) to work, but when I tried to use vbcrlf it would make it [vbcrlf] and wouldn't work. What am I doing wrong?
 
Hi again!

The vbCr, vbLf, vbCrLF, vbNewLine are vb/vba constants and (as I've understood) not available in controlsources, but only when coding.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top