How can I write an expression that will make new lines?

  • Thread starter Thread starter Angela M
  • Start date Start date
A

Angela M

In a report, I want to join the different fields of an
address, but if there is no data in a line, I don't want
it to show a gap.I also want it to go to a new line after
each field.
Can someone tell me what changes I would need to make to
this expression which will make it do this?
Nz([Address Line1]&(" "+[Address Line2]&" "+[District]
&" "+[Postcode]))
Also, if you could give me some tips on where to find
examples of other such expressions as I really don't have
much of a clue at all.
Thanks
Angela
 
Try this, it works !

=Trim([Address1]) & " " & Trim([Address2]) & " " & Trim
([District]) & " " & Trim([Postcode])
 
I had the same problem and using Chr(13) & Chr(10)
worked. Except that I can't get the "can shrink property" to work when there
is no information for one of the lines. I have a 4 line address and some
addresses have the third line and some don't. How do I get the third line to
hide if there is no info- using this format? Thanks.

Douglas J. Steele said:
Instead of the " " in your expression, use Chr(13) & Chr(10)

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Angela M said:
In a report, I want to join the different fields of an
address, but if there is no data in a line, I don't want
it to show a gap.I also want it to go to a new line after
each field.
Can someone tell me what changes I would need to make to
this expression which will make it do this?
Nz([Address Line1]&(" "+[Address Line2]&" "+[District]
&" "+[Postcode]))
Also, if you could give me some tips on where to find
examples of other such expressions as I really don't have
much of a clue at all.
Thanks
Angela
 
Back
Top