473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 49665
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Abhi | last post by:
I have a simple Combo box on my Form, Data in it is Coming from database, Data is stored in database Through a form where i am using Textbox to enter data The Source data to combobox contains...
1
by: VMI | last post by:
If I want to separate a string in a web textbox so that it takes several lines, how can do it? In a Windows textbox, I only needed to add the "\r\n" to the string for the carriage return....
1
by: Steve | last post by:
I have a simple form with a textbox and a command button, both web form controls (not raw HTML controls). I notice that when the user enters text in the textbox and hits carriage return, the form...
7
by: Nathan | last post by:
How do you code a carriage return in a textbox? For example, Txtbox1.Text = "My address:" & ?CarriageReturn? & "555 Maple" & ?CarriageReturn? & "Somewhere, USA" so that the textbox shows the...
2
by: senfo | last post by:
Hello all, To help alleviate human error, I'm developing an application that uses a barcode reader to fill in a value in a TextBox control. The barcode reader is connected to the PC through the...
2
by: dancer | last post by:
Using ASP.Net and VB.net I have textboxes (<asp:textbox id......>) in which the user will be entering paragraphs. They are multiline (several rows and several columns). The carriage returns...
3
by: HockeyFan | last post by:
I've done this before by trapping keydown and checking for a CR, and then clicking a particular button based on which textbox the event happened. However, I was wondering if there's a simpler way...
11
by: evenlater | last post by:
My db allows the user to send email via CDO. The body of the email is determined in code. I have built an email form with To, CC and Subject lines and a large text box for the body of the message...
7
by: satyabhaskar | last post by:
hi all, In my web page i have 3 text boxes and one submit button...Actually my problem is how do i focus on 2nd text box upon (pressing enter key)carriage return press in the first text box...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.