title: Inserting a line break in a Access report text field when a certain condition is met
body: <p>Alright, to begin with, I am not an expert in using reports / forms in Access. The original Access file originates from Access 2000 and I am rebuilding it now to Access 2013, plus adding a few style changes including a line break in a my report. </p>
  
  <p>At first I thought a line break wouldn't be to hard and that I could easily add it in a textbox with either  or &amp; Chr(13) &amp; Chr(10) - also tried it with the $ after the Chr. This didn't worked though.</p>
  
  <p><strong>The problem / background</strong></p>
  
  <p>So I have got a report that shows some values that are retrieved from a query. These values are displayed in text boxes. </p>
  
  <p>I have one hidden field that retrieves a single query value (relations) that is inserted in its control source, this seems to work. </p>
  
  <p>The following thing I want to do is checking if the value is not empty, and if it isn't then output the value after a line break. </p>
  
  <p><strong>More background</strong></p>
  
  <p>This is being done for address information. Sometimes a relation has 2 address lines instead of just one, so if the relation has 2 lines then it needs to show both lines while if the relation only has one line it should show just one line (without a blank enter). To give an idea:</p>
  
  <p><strong>Relation A:</strong></p>
  
  <pre><code>Company Name X 
  Street Name and number
  Zipcode
  </code></pre>
  
  <p><strong>Relation B:</strong></p>
  
  <pre><code>Company Name Y
  Second Name Z 
  Street Name and number
  Zipcode
  </code></pre>
  
  <p>If I would insert both the company names separate, then you would get a hideous blank line break if the company doesn't have a second name. </p>
  
  <p><strong>So the textbox code is:</strong> </p>
  
  <pre><code>RelationName (retrieved from query)
  RelationName2 (retrieved from query)
  StreetName (retrieved from query)
  Zipcode (retrieved from query)
  </code></pre>
  
  <p><strong>And for company A it then would look like:</strong></p>
  
  <pre><code>Company Name X 
  
  Street Name and number
  Zipcode
  </code></pre>
  
  <p>I thought I could fix this by adding a condition for the second name textbox: </p>
  
  <pre><code>=IIf([RelationName2]&lt;&gt;"",Chr(13) &amp; Chr(10) &amp; [RelationName2],"")
  </code></pre>
  
  <p>So if relation name 2 exists, then do a line break and output the second relation name else do nothing (leave empty).</p>
  
  <p>In code this looks like (the {} are textboxes):</p>
  
  <pre><code>{RelationName}  {=IIf([RelationName2]&lt;&gt;"",Chr(13) &amp; Chr(10) &amp; [RelationName2],"")}   
  {StreetName} 
  {Zipcode}
  </code></pre>
  
  <p>The line breaks don't work though, and because of this I also cant test if the line break even works when the condition is met. Perhaps there are other ways to do it (instead of using line breaks). P.S. I also tried setting the textbox text format to rich text instead of plain text. </p>