• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 463
  • Last Modified:

Using a New Line Character in Expression Builder

Ok, here is my problem.  I have one text box that I'm joining multiple fields into with IIf() statements.  The problem is I need each field to appear on a new line.  For example;

IIf(field1 = "A","A",Null) & IIf(field2 = "C","C",Null)

I need the results to appear like this following, assuming both statements are true.

A
C

Is there a 'New Line' character that I can use between the IIf statements to display the results on a seperate line.

Thanks.
0
jdobbs88
Asked:
jdobbs88
1 Solution
 
mbizupCommented:
Try this:
IIf(field1 = "A","A",Null) & vbcrlf &  IIf(field2 = "C","C",Null)

or:

IIf(field1 = "A","A",Null) & CHR(10) & chr(13) &  IIf(field2 = "C","C",Null)   '* Chr(10) and chr(13) may need to be reversed

0
 
GRayLCommented:
Maybe this:

If(field1 = "A","A" & vbcrlf,Null) & IIf(field2 = "C","C" & vbcrlf,Null)) . etc.  This will leave a 'blank' line at the end.  Is that OK?
0
 
OnALearningCurveCommented:
This Might also wok

IIf(field1 = "A","A"&(Chr(13)),Null) & IIf(field2 = "C","C"&(Chr(13)),Null) ....

Hope this helps,

Mark.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
jdobbs88Author Commented:
Thanks for the help everyone.  I tried all three examples and the only one that worked was a combination of CHR(10) & CHR(13)

Thanks again for everyone's help
0
 
mbizupCommented:
Glad to help
0
 
OnALearningCurveCommented:
Sorry for posting the same answer twice!

I had not full read mbizup's first post

Mark.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now