469,326 Members | 1,359 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,326 developers. It's quick & easy.

Inserting a Carriage Return in a Textbox

aw
Hi MVP's,

I have a VB expression that inserts text in a report's textbox:

(code in report's On-Active)

If not isnull(forms!myform!subject1) then
TextBox = "John Doe"
End If

How do I insert a carriage return into the textbox using VB? I would like
to feed multiple lines into the textbox so that my output ends like this:

John Doe
Addres1 #101
Tallahasee, MD 0000
Any information will be greatly appreciated...
--
Thanks a million!
Nov 13 '05 #1
5 48637
Me!Mytextbox = "John Doe" & Chr(10) & Chr(13) & "Address1 #101" _
& Chr(10) & Chr(13) & "Tallahasee, MD 0000"
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"aw" <aw@spam.is.nul> wrote in message
news:4e******************************@news.1usenet .com...
Hi MVP's,

I have a VB expression that inserts text in a report's textbox:

(code in report's On-Active)

If not isnull(forms!myform!subject1) then
TextBox = "John Doe"
End If

How do I insert a carriage return into the textbox using VB? I would like
to feed multiple lines into the textbox so that my output ends like this:

John Doe
Addres1 #101
Tallahasee, MD 0000
Any information will be greatly appreciated...
--
Thanks a million!

Nov 13 '05 #2
aw wrote:

Any information will be greatly appreciated...


Oddly enough, I'm an Access newbie that was looking for the same answer.
I found it this morning.

Use
& Chr(13) & Chr(10) &

between your fields and it will insert the carriage returns. I ended up
googling this newsgroup on groups.google.com to find the answer. I
couldn't find it in Access' "help" anywhere.

Nov 13 '05 #3
I like vbCrLf instead of the CHR() functions.

TextBox = "John Doe" & vbCrLf & _
"Addres1 #101" & vbCrLf & _
"Tallahasee, MD 0000"

Fred Zuckerman

"aw" <aw@spam.is.nul> wrote in message
news:4e******************************@news.1usenet .com...
Hi MVP's,

I have a VB expression that inserts text in a report's textbox:

(code in report's On-Active)

If not isnull(forms!myform!subject1) then
TextBox = "John Doe"
End If

How do I insert a carriage return into the textbox using VB? I would like
to feed multiple lines into the textbox so that my output ends like this:

John Doe
Addres1 #101
Tallahasee, MD 0000
Any information will be greatly appreciated...
--
Thanks a million!

Nov 13 '05 #4
In a Standard Module

Public strName As String, strAddr1 As String, strAddr2 As String

Somewhere
strName = "John Doe"
strAddr1 = "123 1st St."
strAddr2 = "Su City, IO"

If not isnull(forms!myform!subject1) then
TextBox = strName & vbCrLf & strAddr1 & vbCrLf & strAddr2
End If
Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #5
aw


Thank you all for your answers...
Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Abhi | last post: by
1 post views Thread by VMI | last post: by
7 posts views Thread by Nathan | last post: by
2 posts views Thread by senfo | last post: by
2 posts views Thread by dancer | last post: by
3 posts views Thread by HockeyFan | last post: by
11 posts views Thread by evenlater | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.