New Line in a Trim Statement

G

Guest

I'm using a Trim() statement to string together a number of fields into one
entry. Is there any way to force a new line within the Trim statement so the
entry would appear on more than one line on my report?

For instance, instead of:
Joe Smith, Mockingbird Lane, Detroit, MI

I would get:
Joe Smith
Mockingbird Lane
Detroit, MI

Thanks for your assistance.

Kevin D.
 
M

Marshall Barton

Kevin said:
I'm using a Trim() statement to string together a number of fields into one
entry. Is there any way to force a new line within the Trim statement so the
entry would appear on more than one line on my report?

For instance, instead of:
Joe Smith, Mockingbird Lane, Detroit, MI

I would get:
Joe Smith
Mockingbird Lane
Detroit, MI


Trim can't do that.

If that address were all in one value and if you can
guarantee the first two commas will always be there, you
could use:
Replace([yourfield], ",", Chr(13) & Chr(10), 1, 2)

OTOH, if you have 4 separate values, you could use something
like:
Fname & Chr(13) & Chr(10) & (Street + Chr(13) + Chr(10)) &
(City + ", ") & State
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top