473,413 Members | 1,807 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,413 software developers and data experts.

Newline in String?

Hello everybody

I really can't find out howto add a newline into a simple string. I want to
do something like:

=IIf([req_description]<>"";"Description: " & [req_description];"")

....but with a newline after "Description:". How do I enter a newline?
Thanks for your help

Jean-Pierre
Nov 13 '05 #1
3 12886
Try:
=IIf(IsNull([req_description]), Null, "Description:" & Chr(13) & Chr(10) &
[req_description])

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Jean-Pierre Bergamin" <ja***@se-community.com> wrote in message
news:42**********************@news.sunrise.ch...
Hello everybody

I really can't find out howto add a newline into a simple string. I want
to
do something like:

=IIf([req_description]<>"";"Description: " & [req_description];"")

...but with a newline after "Description:". How do I enter a newline?
Thanks for your help

Jean-Pierre

Nov 13 '05 #2
Allen Browne wrote:
Try:
=IIf(IsNull([req_description]), Null, "Description:" & Chr(13) & Chr(10) &
[req_description])


How about
="Description:" + vbCRLF + [req_description]

As (AFAIK) the + concatenator would render the whole expression as null
if req_description was null.

--
[Oo=w=oO]

Nov 13 '05 #3
Yes, that's fine, except the line starting with = made me wonder if this is
the Control Source of a text box? If so the constant (vbCrLf) is not
available.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Trevor Best" <no****@besty.org.uk> wrote in message
news:42***********************@news.zen.co.uk...
Allen Browne wrote:
Try:
=IIf(IsNull([req_description]), Null, "Description:" & Chr(13) & Chr(10)
& [req_description])


How about
="Description:" + vbCRLF + [req_description]

As (AFAIK) the + concatenator would render the whole expression as null if
req_description was null.

--
[Oo=w=oO]

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Kaka | last post by:
Hi, I am a learner for C# and .Net. I want to know how to put a line break to a string so that when it show in the textbox the text will be displayed in saperated lines. e.g.: String s; s...
2
by: John Dalberg | last post by:
Hi What's the regex to remove the carriage return/line field from a string? These can occur multiple times in the string as in xxx\r\n\r\n. -- John Dalberg
29
by: runningdog | last post by:
Hi, I would like to be able to embed a newline in a text string. Is there any convienent notation to do this TIA Steve
4
by: Peter Kirk | last post by:
Hi I would like to ask a little bit about the value Environment.Newline: what is it and what is the point of it? Ok, I can see in the docs that it represents "newline" for the current platform -...
3
by: retsam | last post by:
All, I'm working on an ASP.NET 2.0 (C#) page and have a question on how to build a string that includes line feeds (new lines) that displays properly on an ASP.NET page. Here's what I got: ...
5
by: Daniel | last post by:
Hi I would like to remove everything else but one line of text in a String. I have tried using .Split("\n"), however I did not succeed. The string contains three lines, but I only need the...
8
by: simonZ | last post by:
I have Function with string parameteres: public string newLine(String string1,String string2,String string3){ StringBuilder webLine = new StringBuilder(); webLine.Append("<tD nowrap>" +...
11
by: rossum | last post by:
I want to declare a const multi-line string inside a method, and I am having some problems using Environment.NewLine. I started out with: class foo { public void PrintStuff() { const...
2
by: tshad | last post by:
I have the following code Dim val As Int16 = 7 Dim name As String = "Mr. John" Dim num As Double = 45.06F Dim str As String = String.Format("Days Left : {0}. Current DataTime: {1:u}. \n...
5
by: alex21 | last post by:
I am trying to write a function for determining the data type of columns in a delimited file. However my function is not detecting a newline and exiting the loop after the end of the first line. ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.