• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 460
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

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