Linefeed when concatenating strings

T

Toby

I'm trying to create a field in an address book that has the entire address ready formatted for cutting & pasting into another application for printing out a label

Therefore I need to concatenate the contents of several fields in my form design. No problem except that I also need to insert linefeeds at the end of each line of the address

If it possible to achieve this using an expression

Replies to my e-mail address would be wonderful: (e-mail address removed)

Thanks a bunch!
 
A

Arvin Meyer

In a query, you need to use functions, not constants to perform a line feed,
so use something like:

Expr1: [Line1] & Chr(13) & Chr(10) & [Line2] & Chr(13) & Chr(10) & [Line3]
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

Toby said:
I'm trying to create a field in an address book that has the entire
address ready formatted for cutting & pasting into another application for
printing out a label.
Therefore I need to concatenate the contents of several fields in my form
design. No problem except that I also need to insert linefeeds at the end of
each line of the address.
 
J

Jim/Chris

I got this from a previous post

If you are working in VB code, use the vbCRLF (carriage
return, line feed).
If you are working in a query, you might need to use
Chr(10) & Chr(13) (I
think I got those pesky ASCIIs correct...<g>)

Jim
-----Original Message-----
I'm trying to create a field in an address book that has
the entire address ready formatted for cutting & pasting
into another application for printing out a label.
Therefore I need to concatenate the contents of several
fields in my form design. No problem except that I also
need to insert linefeeds at the end of each line of the
address.
 
J

John Vinson

If you are working in a query, you might need to use
Chr(10) & Chr(13) (I
think I got those pesky ASCIIs correct...<g>)

Pesky indeed! They're correct but in the wrong order - it needs to be
Chr(13) & Chr(10).
 

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