Help with Query leading to Form

T

Tony

I am trying to take a few fields from a table.

The table is filled with Company Names, Addresses, Phone and Fax Numbers.

What I am trying to do is create a query that will in turn put everything
into one field so I can create a form to copy the data to so that I can paste
the info into a Bill Of Lading.

What I want to do is after the Company Name add a carriage return, after the
address add a carriage return and so on. Would look like this ideally in the
form after the query is created.

Murphy Warehouse
C/O: Mike Butchert
701 - 24th Ave S.E.
Minneapolis, MN 55414
612-623-1200


Here is my Sql that I am writing and it is giving me the square value for
the carriage return and does not do the carriage return when I create my form
and set the properties multiline to true.

SELECT [Origin] & Chr(13) & [C/O] & Chr(13) & [Address] & Chr(13) & [City] &
", " & [ST] & " " & [ZipCode] & Chr(13) & [PhoneNmbr] AS Orig
FROM Origins;
 
D

Douglas J. Steele

You need both a Carriage Return (Chr(13)) AND a Line Feed (Chr(10)), in that
order.
 
T

Tony

So I am writing it like this:

SELECT [Origin] & (Chr(13))(Chr(10)) or (Chr(13)) And (Chr(10))

Thanks for your help

Douglas J. Steele said:
You need both a Carriage Return (Chr(13)) AND a Line Feed (Chr(10)), in that
order.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Tony said:
I am trying to take a few fields from a table.

The table is filled with Company Names, Addresses, Phone and Fax Numbers.

What I am trying to do is create a query that will in turn put everything
into one field so I can create a form to copy the data to so that I can
paste
the info into a Bill Of Lading.

What I want to do is after the Company Name add a carriage return, after
the
address add a carriage return and so on. Would look like this ideally in
the
form after the query is created.

Murphy Warehouse
C/O: Mike Butchert
701 - 24th Ave S.E.
Minneapolis, MN 55414
612-623-1200


Here is my Sql that I am writing and it is giving me the square value for
the carriage return and does not do the carriage return when I create my
form
and set the properties multiline to true.

SELECT [Origin] & Chr(13) & [C/O] & Chr(13) & [Address] & Chr(13) & [City]
&
", " & [ST] & " " & [ZipCode] & Chr(13) & [PhoneNmbr] AS Orig
FROM Origins;
 
T

Tony

I tried (Chr(13)) And (Chr(10)) and the result comes back as a -1. So I am
not sure what I am missing.

Tony said:
So I am writing it like this:

SELECT [Origin] & (Chr(13))(Chr(10)) or (Chr(13)) And (Chr(10))

Thanks for your help

Douglas J. Steele said:
You need both a Carriage Return (Chr(13)) AND a Line Feed (Chr(10)), in that
order.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Tony said:
I am trying to take a few fields from a table.

The table is filled with Company Names, Addresses, Phone and Fax Numbers.

What I am trying to do is create a query that will in turn put everything
into one field so I can create a form to copy the data to so that I can
paste
the info into a Bill Of Lading.

What I want to do is after the Company Name add a carriage return, after
the
address add a carriage return and so on. Would look like this ideally in
the
form after the query is created.

Murphy Warehouse
C/O: Mike Butchert
701 - 24th Ave S.E.
Minneapolis, MN 55414
612-623-1200


Here is my Sql that I am writing and it is giving me the square value for
the carriage return and does not do the carriage return when I create my
form
and set the properties multiline to true.

SELECT [Origin] & Chr(13) & [C/O] & Chr(13) & [Address] & Chr(13) & [City]
&
", " & [ST] & " " & [ZipCode] & Chr(13) & [PhoneNmbr] AS Orig
FROM Origins;
 
D

Douglas J. Steele

SELECT [Origin] & Chr(13) & Chr(10) & [C/O] & Chr(13) & Chr(10) &
[Address]...

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Tony said:
So I am writing it like this:

SELECT [Origin] & (Chr(13))(Chr(10)) or (Chr(13)) And (Chr(10))

Thanks for your help

Douglas J. Steele said:
You need both a Carriage Return (Chr(13)) AND a Line Feed (Chr(10)), in
that
order.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Tony said:
I am trying to take a few fields from a table.

The table is filled with Company Names, Addresses, Phone and Fax
Numbers.

What I am trying to do is create a query that will in turn put
everything
into one field so I can create a form to copy the data to so that I can
paste
the info into a Bill Of Lading.

What I want to do is after the Company Name add a carriage return,
after
the
address add a carriage return and so on. Would look like this ideally
in
the
form after the query is created.

Murphy Warehouse
C/O: Mike Butchert
701 - 24th Ave S.E.
Minneapolis, MN 55414
612-623-1200


Here is my Sql that I am writing and it is giving me the square value
for
the carriage return and does not do the carriage return when I create
my
form
and set the properties multiline to true.

SELECT [Origin] & Chr(13) & [C/O] & Chr(13) & [Address] & Chr(13) &
[City]
&
", " & [ST] & " " & [ZipCode] & Chr(13) & [PhoneNmbr] AS Orig
FROM Origins;
 
T

Tony

Thanks. I did figure it out using different sql.

SELECT [Origin] & (Chr(13)) & "" & (Chr(10)) & [C/O] & (Chr(13)) & "" &
(Chr(10)) & [Address] & (Chr(13)) & "" & (Chr(10)) & [City] & ", " & [ST] & "
" & [ZipCode] & (Chr(13)) & "" & (Chr(10)) & [PhoneNmbr] AS Orig
FROM Origins;

Douglas J. Steele said:
SELECT [Origin] & Chr(13) & Chr(10) & [C/O] & Chr(13) & Chr(10) &
[Address]...

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Tony said:
So I am writing it like this:

SELECT [Origin] & (Chr(13))(Chr(10)) or (Chr(13)) And (Chr(10))

Thanks for your help

Douglas J. Steele said:
You need both a Carriage Return (Chr(13)) AND a Line Feed (Chr(10)), in
that
order.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



I am trying to take a few fields from a table.

The table is filled with Company Names, Addresses, Phone and Fax
Numbers.

What I am trying to do is create a query that will in turn put
everything
into one field so I can create a form to copy the data to so that I can
paste
the info into a Bill Of Lading.

What I want to do is after the Company Name add a carriage return,
after
the
address add a carriage return and so on. Would look like this ideally
in
the
form after the query is created.

Murphy Warehouse
C/O: Mike Butchert
701 - 24th Ave S.E.
Minneapolis, MN 55414
612-623-1200


Here is my Sql that I am writing and it is giving me the square value
for
the carriage return and does not do the carriage return when I create
my
form
and set the properties multiline to true.

SELECT [Origin] & Chr(13) & [C/O] & Chr(13) & [Address] & Chr(13) &
[City]
&
", " & [ST] & " " & [ZipCode] & Chr(13) & [PhoneNmbr] AS Orig
FROM Origins;
 
D

Douglas J. Steele

There's no reason for the & "" &, nor for the parentheses around Chr(13) or
Chr(10)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Tony said:
Thanks. I did figure it out using different sql.

SELECT [Origin] & (Chr(13)) & "" & (Chr(10)) & [C/O] & (Chr(13)) & "" &
(Chr(10)) & [Address] & (Chr(13)) & "" & (Chr(10)) & [City] & ", " & [ST]
& "
" & [ZipCode] & (Chr(13)) & "" & (Chr(10)) & [PhoneNmbr] AS Orig
FROM Origins;

Douglas J. Steele said:
SELECT [Origin] & Chr(13) & Chr(10) & [C/O] & Chr(13) & Chr(10) &
[Address]...

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Tony said:
So I am writing it like this:

SELECT [Origin] & (Chr(13))(Chr(10)) or (Chr(13)) And (Chr(10))

Thanks for your help

:

You need both a Carriage Return (Chr(13)) AND a Line Feed (Chr(10)),
in
that
order.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



I am trying to take a few fields from a table.

The table is filled with Company Names, Addresses, Phone and Fax
Numbers.

What I am trying to do is create a query that will in turn put
everything
into one field so I can create a form to copy the data to so that I
can
paste
the info into a Bill Of Lading.

What I want to do is after the Company Name add a carriage return,
after
the
address add a carriage return and so on. Would look like this
ideally
in
the
form after the query is created.

Murphy Warehouse
C/O: Mike Butchert
701 - 24th Ave S.E.
Minneapolis, MN 55414
612-623-1200


Here is my Sql that I am writing and it is giving me the square
value
for
the carriage return and does not do the carriage return when I
create
my
form
and set the properties multiline to true.

SELECT [Origin] & Chr(13) & [C/O] & Chr(13) & [Address] & Chr(13) &
[City]
&
", " & [ST] & " " & [ZipCode] & Chr(13) & [PhoneNmbr] AS Orig
FROM Origins;
 

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