ignoring format/control codes exporting data from access to excel

H

Horsecat

I am trying to export data from access that has control returns in the basic
format of the field. When data is exported to excel (or imported by query in
excel) these codes cause the data to be spread out and sometimes cut off.
How can I run a query in access and export that data completely ingnoring the
control returns. Or as an alternative, how can I copy fields from access and
paste them into excell and have the control characters ingnored. Or run a
query in excel that imports data ingnoring the codes?
 
D

Douglas J. Steele

Create a query that replaces the Carriage Return/Line Feed Access uses with
just a Line Feed (which is all Excel requires), and export the query rather
than the table:

Replace([MyField], Chr(13) & Chr(10), Chr(10))

If that doesn't work, try replacing the Carriage Return/Line Feed with a
space:

Replace([MyField], Chr(13) & Chr(10), " ")
 
H

Horsecat

Do I put this code in the query criteria for that field? If I want to remove
the returns all together what would my line look like? I am not familiar
enough with this to know what to put in the variables - so my field is
ProductionProcedure - would my line be replace[ProductionProcedure], Chr(13)
& Chr(10), " ") - are the Chr(13) & Chr(10) the codes for the carriage
return/line feed codes?

thanks so much for your help
Delma

Douglas J. Steele said:
Create a query that replaces the Carriage Return/Line Feed Access uses with
just a Line Feed (which is all Excel requires), and export the query rather
than the table:

Replace([MyField], Chr(13) & Chr(10), Chr(10))

If that doesn't work, try replacing the Carriage Return/Line Feed with a
space:

Replace([MyField], Chr(13) & Chr(10), " ")

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
I am trying to export data from access that has control returns in the
basic
format of the field. When data is exported to excel (or imported by query
in
excel) these codes cause the data to be spread out and sometimes cut off.
How can I run a query in access and export that data completely ingnoring
the
control returns. Or as an alternative, how can I copy fields from access
and
paste them into excell and have the control characters ingnored. Or run a
query in excel that imports data ingnoring the codes?
 
D

Douglas J. Steele

Yes, Chr(13) is the Carriage Return, Chr(10) is the Line Feed. (If you were
doing it in VBA, as opposed to in a query, you could use the intrinisic
constant vbCrLf)

For a field named ProductionProcedure, you'd put
Replace([ProductionProcedure], Chr(13) & Chr(10), " ") instead of just
ProductionProcedure in the Field row of the query grid.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
Do I put this code in the query criteria for that field? If I want to
remove
the returns all together what would my line look like? I am not familiar
enough with this to know what to put in the variables - so my field is
ProductionProcedure - would my line be replace[ProductionProcedure],
Chr(13)
& Chr(10), " ") - are the Chr(13) & Chr(10) the codes for the carriage
return/line feed codes?

thanks so much for your help
Delma

Douglas J. Steele said:
Create a query that replaces the Carriage Return/Line Feed Access uses
with
just a Line Feed (which is all Excel requires), and export the query
rather
than the table:

Replace([MyField], Chr(13) & Chr(10), Chr(10))

If that doesn't work, try replacing the Carriage Return/Line Feed with a
space:

Replace([MyField], Chr(13) & Chr(10), " ")

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
I am trying to export data from access that has control returns in the
basic
format of the field. When data is exported to excel (or imported by
query
in
excel) these codes cause the data to be spread out and sometimes cut
off.
How can I run a query in access and export that data completely
ingnoring
the
control returns. Or as an alternative, how can I copy fields from
access
and
paste them into excell and have the control characters ingnored. Or
run a
query in excel that imports data ingnoring the codes?
 
H

Horsecat

Thank you so much - I appreciate your help tremendously

thank you
Delma

Douglas J. Steele said:
Yes, Chr(13) is the Carriage Return, Chr(10) is the Line Feed. (If you were
doing it in VBA, as opposed to in a query, you could use the intrinisic
constant vbCrLf)

For a field named ProductionProcedure, you'd put
Replace([ProductionProcedure], Chr(13) & Chr(10), " ") instead of just
ProductionProcedure in the Field row of the query grid.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
Do I put this code in the query criteria for that field? If I want to
remove
the returns all together what would my line look like? I am not familiar
enough with this to know what to put in the variables - so my field is
ProductionProcedure - would my line be replace[ProductionProcedure],
Chr(13)
& Chr(10), " ") - are the Chr(13) & Chr(10) the codes for the carriage
return/line feed codes?

thanks so much for your help
Delma

Douglas J. Steele said:
Create a query that replaces the Carriage Return/Line Feed Access uses
with
just a Line Feed (which is all Excel requires), and export the query
rather
than the table:

Replace([MyField], Chr(13) & Chr(10), Chr(10))

If that doesn't work, try replacing the Carriage Return/Line Feed with a
space:

Replace([MyField], Chr(13) & Chr(10), " ")

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I am trying to export data from access that has control returns in the
basic
format of the field. When data is exported to excel (or imported by
query
in
excel) these codes cause the data to be spread out and sometimes cut
off.
How can I run a query in access and export that data completely
ingnoring
the
control returns. Or as an alternative, how can I copy fields from
access
and
paste them into excell and have the control characters ingnored. Or
run a
query in excel that imports data ingnoring the codes?
 
H

Horsecat

Douglas,

I typed this in just as it reads and I'm getting a syntax error reading
"syntax error (comma) in query expression....." I have tried both of your
suggested lines putting them in the field row of my query and get this same
thing both times. Any suggestions?
thanks
Delma

Douglas J. Steele said:
Yes, Chr(13) is the Carriage Return, Chr(10) is the Line Feed. (If you were
doing it in VBA, as opposed to in a query, you could use the intrinisic
constant vbCrLf)

For a field named ProductionProcedure, you'd put
Replace([ProductionProcedure], Chr(13) & Chr(10), " ") instead of just
ProductionProcedure in the Field row of the query grid.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
Do I put this code in the query criteria for that field? If I want to
remove
the returns all together what would my line look like? I am not familiar
enough with this to know what to put in the variables - so my field is
ProductionProcedure - would my line be replace[ProductionProcedure],
Chr(13)
& Chr(10), " ") - are the Chr(13) & Chr(10) the codes for the carriage
return/line feed codes?

thanks so much for your help
Delma

Douglas J. Steele said:
Create a query that replaces the Carriage Return/Line Feed Access uses
with
just a Line Feed (which is all Excel requires), and export the query
rather
than the table:

Replace([MyField], Chr(13) & Chr(10), Chr(10))

If that doesn't work, try replacing the Carriage Return/Line Feed with a
space:

Replace([MyField], Chr(13) & Chr(10), " ")

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I am trying to export data from access that has control returns in the
basic
format of the field. When data is exported to excel (or imported by
query
in
excel) these codes cause the data to be spread out and sometimes cut
off.
How can I run a query in access and export that data completely
ingnoring
the
control returns. Or as an alternative, how can I copy fields from
access
and
paste them into excell and have the control characters ingnored. Or
run a
query in excel that imports data ingnoring the codes?
 
D

Douglas J. Steele

Is your computer set for a locale that uses ; (semi-colon) as the list
separator rather than , (comma)?

Try:

Replace([MyField]; Chr(13) & Chr(10); " ")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
Douglas,

I typed this in just as it reads and I'm getting a syntax error reading
"syntax error (comma) in query expression....." I have tried both of your
suggested lines putting them in the field row of my query and get this
same
thing both times. Any suggestions?
thanks
Delma

Douglas J. Steele said:
Yes, Chr(13) is the Carriage Return, Chr(10) is the Line Feed. (If you
were
doing it in VBA, as opposed to in a query, you could use the intrinisic
constant vbCrLf)

For a field named ProductionProcedure, you'd put
Replace([ProductionProcedure], Chr(13) & Chr(10), " ") instead of just
ProductionProcedure in the Field row of the query grid.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
Do I put this code in the query criteria for that field? If I want to
remove
the returns all together what would my line look like? I am not
familiar
enough with this to know what to put in the variables - so my field is
ProductionProcedure - would my line be replace[ProductionProcedure],
Chr(13)
& Chr(10), " ") - are the Chr(13) & Chr(10) the codes for the carriage
return/line feed codes?

thanks so much for your help
Delma

:

Create a query that replaces the Carriage Return/Line Feed Access uses
with
just a Line Feed (which is all Excel requires), and export the query
rather
than the table:

Replace([MyField], Chr(13) & Chr(10), Chr(10))

If that doesn't work, try replacing the Carriage Return/Line Feed with
a
space:

Replace([MyField], Chr(13) & Chr(10), " ")

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I am trying to export data from access that has control returns in
the
basic
format of the field. When data is exported to excel (or imported by
query
in
excel) these codes cause the data to be spread out and sometimes cut
off.
How can I run a query in access and export that data completely
ingnoring
the
control returns. Or as an alternative, how can I copy fields from
access
and
paste them into excell and have the control characters ingnored. Or
run a
query in excel that imports data ingnoring the codes?
 
H

Horsecat

no that doesn't do it - I've also tried
replace([myfield], Chr(13) & Chr(10), Chr(32) - also used " " rather than
chr(32)
replace([myfield], Chr(13) + Chr(10), Chr(32)
replace(([myfield], (Chr(13) & Chr(10)), (Chr(32)))
this is the only formula that I don't get a syntax formula error on and I
get a syntax comma error on it:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10)," ")
notice the spaces have been removed when I click off or field and try to run
the query.


Douglas J. Steele said:
Is your computer set for a locale that uses ; (semi-colon) as the list
separator rather than , (comma)?

Try:

Replace([MyField]; Chr(13) & Chr(10); " ")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
Douglas,

I typed this in just as it reads and I'm getting a syntax error reading
"syntax error (comma) in query expression....." I have tried both of your
suggested lines putting them in the field row of my query and get this
same
thing both times. Any suggestions?
thanks
Delma

Douglas J. Steele said:
Yes, Chr(13) is the Carriage Return, Chr(10) is the Line Feed. (If you
were
doing it in VBA, as opposed to in a query, you could use the intrinisic
constant vbCrLf)

For a field named ProductionProcedure, you'd put
Replace([ProductionProcedure], Chr(13) & Chr(10), " ") instead of just
ProductionProcedure in the Field row of the query grid.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Do I put this code in the query criteria for that field? If I want to
remove
the returns all together what would my line look like? I am not
familiar
enough with this to know what to put in the variables - so my field is
ProductionProcedure - would my line be replace[ProductionProcedure],
Chr(13)
& Chr(10), " ") - are the Chr(13) & Chr(10) the codes for the carriage
return/line feed codes?

thanks so much for your help
Delma

:

Create a query that replaces the Carriage Return/Line Feed Access uses
with
just a Line Feed (which is all Excel requires), and export the query
rather
than the table:

Replace([MyField], Chr(13) & Chr(10), Chr(10))

If that doesn't work, try replacing the Carriage Return/Line Feed with
a
space:

Replace([MyField], Chr(13) & Chr(10), " ")

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I am trying to export data from access that has control returns in
the
basic
format of the field. When data is exported to excel (or imported by
query
in
excel) these codes cause the data to be spread out and sometimes cut
off.
How can I run a query in access and export that data completely
ingnoring
the
control returns. Or as an alternative, how can I copy fields from
access
and
paste them into excell and have the control characters ingnored. Or
run a
query in excel that imports data ingnoring the codes?
 
D

Douglas J. Steele

What's the SQL of your query?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
no that doesn't do it - I've also tried
replace([myfield], Chr(13) & Chr(10), Chr(32) - also used " " rather than
chr(32)
replace([myfield], Chr(13) + Chr(10), Chr(32)
replace(([myfield], (Chr(13) & Chr(10)), (Chr(32)))
this is the only formula that I don't get a syntax formula error on and I
get a syntax comma error on it:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10)," ")
notice the spaces have been removed when I click off or field and try to
run
the query.


Douglas J. Steele said:
Is your computer set for a locale that uses ; (semi-colon) as the list
separator rather than , (comma)?

Try:

Replace([MyField]; Chr(13) & Chr(10); " ")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
Douglas,

I typed this in just as it reads and I'm getting a syntax error reading
"syntax error (comma) in query expression....." I have tried both of
your
suggested lines putting them in the field row of my query and get this
same
thing both times. Any suggestions?
thanks
Delma

:

Yes, Chr(13) is the Carriage Return, Chr(10) is the Line Feed. (If you
were
doing it in VBA, as opposed to in a query, you could use the
intrinisic
constant vbCrLf)

For a field named ProductionProcedure, you'd put
Replace([ProductionProcedure], Chr(13) & Chr(10), " ") instead of just
ProductionProcedure in the Field row of the query grid.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Do I put this code in the query criteria for that field? If I want
to
remove
the returns all together what would my line look like? I am not
familiar
enough with this to know what to put in the variables - so my field
is
ProductionProcedure - would my line be replace[ProductionProcedure],
Chr(13)
& Chr(10), " ") - are the Chr(13) & Chr(10) the codes for the
carriage
return/line feed codes?

thanks so much for your help
Delma

:

Create a query that replaces the Carriage Return/Line Feed Access
uses
with
just a Line Feed (which is all Excel requires), and export the
query
rather
than the table:

Replace([MyField], Chr(13) & Chr(10), Chr(10))

If that doesn't work, try replacing the Carriage Return/Line Feed
with
a
space:

Replace([MyField], Chr(13) & Chr(10), " ")

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I am trying to export data from access that has control returns in
the
basic
format of the field. When data is exported to excel (or imported
by
query
in
excel) these codes cause the data to be spread out and sometimes
cut
off.
How can I run a query in access and export that data completely
ingnoring
the
control returns. Or as an alternative, how can I copy fields
from
access
and
paste them into excell and have the control characters ingnored.
Or
run a
query in excel that imports data ingnoring the codes?
 
H

Horsecat

Doug, I don't know - how can I tell the SQL type? I read the help on what
SQL types are, but I have no idea if this is anything other than
normal/typical SQL. Sorry you are asking beyond my knowledge - tell me how I
can find out and I will. Delma

Douglas J. Steele said:
What's the SQL of your query?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
no that doesn't do it - I've also tried
replace([myfield], Chr(13) & Chr(10), Chr(32) - also used " " rather than
chr(32)
replace([myfield], Chr(13) + Chr(10), Chr(32)
replace(([myfield], (Chr(13) & Chr(10)), (Chr(32)))
this is the only formula that I don't get a syntax formula error on and I
get a syntax comma error on it:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10)," ")
notice the spaces have been removed when I click off or field and try to
run
the query.


Douglas J. Steele said:
Is your computer set for a locale that uses ; (semi-colon) as the list
separator rather than , (comma)?

Try:

Replace([MyField]; Chr(13) & Chr(10); " ")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Douglas,

I typed this in just as it reads and I'm getting a syntax error reading
"syntax error (comma) in query expression....." I have tried both of
your
suggested lines putting them in the field row of my query and get this
same
thing both times. Any suggestions?
thanks
Delma

:

Yes, Chr(13) is the Carriage Return, Chr(10) is the Line Feed. (If you
were
doing it in VBA, as opposed to in a query, you could use the
intrinisic
constant vbCrLf)

For a field named ProductionProcedure, you'd put
Replace([ProductionProcedure], Chr(13) & Chr(10), " ") instead of just
ProductionProcedure in the Field row of the query grid.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Do I put this code in the query criteria for that field? If I want
to
remove
the returns all together what would my line look like? I am not
familiar
enough with this to know what to put in the variables - so my field
is
ProductionProcedure - would my line be replace[ProductionProcedure],
Chr(13)
& Chr(10), " ") - are the Chr(13) & Chr(10) the codes for the
carriage
return/line feed codes?

thanks so much for your help
Delma

:

Create a query that replaces the Carriage Return/Line Feed Access
uses
with
just a Line Feed (which is all Excel requires), and export the
query
rather
than the table:

Replace([MyField], Chr(13) & Chr(10), Chr(10))

If that doesn't work, try replacing the Carriage Return/Line Feed
with
a
space:

Replace([MyField], Chr(13) & Chr(10), " ")

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I am trying to export data from access that has control returns in
the
basic
format of the field. When data is exported to excel (or imported
by
query
in
excel) these codes cause the data to be spread out and sometimes
cut
off.
How can I run a query in access and export that data completely
ingnoring
the
control returns. Or as an alternative, how can I copy fields
from
access
and
paste them into excell and have the control characters ingnored.
Or
run a
query in excel that imports data ingnoring the codes?
 
H

Horsecat

Doug I'm sorry I have no idea what the SQL is - tell me how to find out and
I will. I read the help file on SQL types and still have no idea.

I think I have come up with something that the boss can use that will
satisfy her - I have finally got the entire field exporting to excel which
does enough for her, but now my curiousity is taking over of course.

Let me regress a bit - I have a field in a table that is populated by other
fields as they are input on a form. The code behind this also adds blank
lines to make this field "look nice." This is a memo field and when the
report and exported to excel to send to our distributors, the data is cut off
mid stream. This field on the report was set to "no" to expansion. I
changed the field to "yes" allow expansion and the full information now is on
the report in that field. But when I export that report to excel the field
is cut off about mid way.
So my problem is I have a report in access that when exported to excel this
field is cut off and not all information is sent to excel.
If I export from the query that this report is ran from I can get the all
the data for that field exported, but the little square codes that are at the
end of each of the three statements that are put in this field (what I think
are control returns) are sent with the data and the data is of course spread
out with this formatting.
The following is the code that I found in the table for that field that is
getting populated - I guess maybe the problem is with the vbCrLf statements?
Is that what I need to remove at the query? - thanks

Left(Me.CatalogNum, 4)
If strCatNum = "A300" Or strCatNum = "A301" Or strCatNum = "A302" Or
strCatNum = "A303" Or strCatNum = "A304" Or strCatNum = "A305" Then
Me.ProdProcedures = "Antibody was affinity purified using an
epitope specific to " & [Target] & _
" immobilized on solid support." & vbCrLf & vbCrLf & "The
epitope recognized by " & [CatalogNum] & _
" maps to a region between residue ?? and ?? of ?? using the
numbering given in entry ?? (GeneID ??)." & _
vbCrLf & vbCrLf & "Antibody concentration was determined by
extinction coefficient: " & _
"absorbance at 280 nm of 1.4 equals 1.0 mg of IgG."

Thanks so much
Delma




Douglas J. Steele said:
What's the SQL of your query?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
no that doesn't do it - I've also tried
replace([myfield], Chr(13) & Chr(10), Chr(32) - also used " " rather than
chr(32)
replace([myfield], Chr(13) + Chr(10), Chr(32)
replace(([myfield], (Chr(13) & Chr(10)), (Chr(32)))
this is the only formula that I don't get a syntax formula error on and I
get a syntax comma error on it:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10)," ")
notice the spaces have been removed when I click off or field and try to
run
the query.


Douglas J. Steele said:
Is your computer set for a locale that uses ; (semi-colon) as the list
separator rather than , (comma)?

Try:

Replace([MyField]; Chr(13) & Chr(10); " ")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Douglas,

I typed this in just as it reads and I'm getting a syntax error reading
"syntax error (comma) in query expression....." I have tried both of
your
suggested lines putting them in the field row of my query and get this
same
thing both times. Any suggestions?
thanks
Delma

:

Yes, Chr(13) is the Carriage Return, Chr(10) is the Line Feed. (If you
were
doing it in VBA, as opposed to in a query, you could use the
intrinisic
constant vbCrLf)

For a field named ProductionProcedure, you'd put
Replace([ProductionProcedure], Chr(13) & Chr(10), " ") instead of just
ProductionProcedure in the Field row of the query grid.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Do I put this code in the query criteria for that field? If I want
to
remove
the returns all together what would my line look like? I am not
familiar
enough with this to know what to put in the variables - so my field
is
ProductionProcedure - would my line be replace[ProductionProcedure],
Chr(13)
& Chr(10), " ") - are the Chr(13) & Chr(10) the codes for the
carriage
return/line feed codes?

thanks so much for your help
Delma

:

Create a query that replaces the Carriage Return/Line Feed Access
uses
with
just a Line Feed (which is all Excel requires), and export the
query
rather
than the table:

Replace([MyField], Chr(13) & Chr(10), Chr(10))

If that doesn't work, try replacing the Carriage Return/Line Feed
with
a
space:

Replace([MyField], Chr(13) & Chr(10), " ")

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I am trying to export data from access that has control returns in
the
basic
format of the field. When data is exported to excel (or imported
by
query
in
excel) these codes cause the data to be spread out and sometimes
cut
off.
How can I run a query in access and export that data completely
ingnoring
the
control returns. Or as an alternative, how can I copy fields
from
access
and
paste them into excell and have the control characters ingnored.
Or
run a
query in excel that imports data ingnoring the codes?
 
D

Douglas J. Steele

Are you using Replace in a query or in VBA code?

If you're using it in a query, open the query in Design view, then select
SQL View from the View menu. Copy what's shown there into your reply.

If you change the vbCrLf to just vbLf in your code, it won't read properly
in Access: you'll get a small rectangle rather than a new line.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
Doug I'm sorry I have no idea what the SQL is - tell me how to find out
and
I will. I read the help file on SQL types and still have no idea.

I think I have come up with something that the boss can use that will
satisfy her - I have finally got the entire field exporting to excel which
does enough for her, but now my curiousity is taking over of course.

Let me regress a bit - I have a field in a table that is populated by
other
fields as they are input on a form. The code behind this also adds blank
lines to make this field "look nice." This is a memo field and when the
report and exported to excel to send to our distributors, the data is cut
off
mid stream. This field on the report was set to "no" to expansion. I
changed the field to "yes" allow expansion and the full information now is
on
the report in that field. But when I export that report to excel the
field
is cut off about mid way.
So my problem is I have a report in access that when exported to excel
this
field is cut off and not all information is sent to excel.
If I export from the query that this report is ran from I can get the all
the data for that field exported, but the little square codes that are at
the
end of each of the three statements that are put in this field (what I
think
are control returns) are sent with the data and the data is of course
spread
out with this formatting.
The following is the code that I found in the table for that field that is
getting populated - I guess maybe the problem is with the vbCrLf
statements?
Is that what I need to remove at the query? - thanks

Left(Me.CatalogNum, 4)
If strCatNum = "A300" Or strCatNum = "A301" Or strCatNum = "A302" Or
strCatNum = "A303" Or strCatNum = "A304" Or strCatNum = "A305" Then
Me.ProdProcedures = "Antibody was affinity purified using an
epitope specific to " & [Target] & _
" immobilized on solid support." & vbCrLf & vbCrLf & "The
epitope recognized by " & [CatalogNum] & _
" maps to a region between residue ?? and ?? of ?? using the
numbering given in entry ?? (GeneID ??)." & _
vbCrLf & vbCrLf & "Antibody concentration was determined by
extinction coefficient: " & _
"absorbance at 280 nm of 1.4 equals 1.0 mg of IgG."

Thanks so much
Delma




Douglas J. Steele said:
What's the SQL of your query?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
no that doesn't do it - I've also tried
replace([myfield], Chr(13) & Chr(10), Chr(32) - also used " " rather
than
chr(32)
replace([myfield], Chr(13) + Chr(10), Chr(32)
replace(([myfield], (Chr(13) & Chr(10)), (Chr(32)))
this is the only formula that I don't get a syntax formula error on and
I
get a syntax comma error on it:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10)," ")
notice the spaces have been removed when I click off or field and try
to
run
the query.


:

Is your computer set for a locale that uses ; (semi-colon) as the list
separator rather than , (comma)?

Try:

Replace([MyField]; Chr(13) & Chr(10); " ")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Douglas,

I typed this in just as it reads and I'm getting a syntax error
reading
"syntax error (comma) in query expression....." I have tried both
of
your
suggested lines putting them in the field row of my query and get
this
same
thing both times. Any suggestions?
thanks
Delma

:

Yes, Chr(13) is the Carriage Return, Chr(10) is the Line Feed. (If
you
were
doing it in VBA, as opposed to in a query, you could use the
intrinisic
constant vbCrLf)

For a field named ProductionProcedure, you'd put
Replace([ProductionProcedure], Chr(13) & Chr(10), " ") instead of
just
ProductionProcedure in the Field row of the query grid.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Do I put this code in the query criteria for that field? If I
want
to
remove
the returns all together what would my line look like? I am not
familiar
enough with this to know what to put in the variables - so my
field
is
ProductionProcedure - would my line be
replace[ProductionProcedure],
Chr(13)
& Chr(10), " ") - are the Chr(13) & Chr(10) the codes for the
carriage
return/line feed codes?

thanks so much for your help
Delma

:

Create a query that replaces the Carriage Return/Line Feed
Access
uses
with
just a Line Feed (which is all Excel requires), and export the
query
rather
than the table:

Replace([MyField], Chr(13) & Chr(10), Chr(10))

If that doesn't work, try replacing the Carriage Return/Line
Feed
with
a
space:

Replace([MyField], Chr(13) & Chr(10), " ")

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I am trying to export data from access that has control returns
in
the
basic
format of the field. When data is exported to excel (or
imported
by
query
in
excel) these codes cause the data to be spread out and
sometimes
cut
off.
How can I run a query in access and export that data
completely
ingnoring
the
control returns. Or as an alternative, how can I copy fields
from
access
and
paste them into excell and have the control characters
ingnored.
Or
run a
query in excel that imports data ingnoring the codes?
 
H

Horsecat

Doug, I'm using in a query - here is the SQL info:
SELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer, tblNewProducts.ShelfLife,
tblNewProducts.ProdProcedures, tblNewProducts.SpeciesReactivity,
tblNewProducts.WB, tblNewProducts.IP, tblNewProducts.IHC, tblNewProducts.ICC,
tblNewProducts.IF, tblNewProducts.ChIP, tblNewProducts.EMSA,
tblNewProducts.Applications, tblNewProducts.Storage,
tblNewProducts.AntibodyType, tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));


Douglas J. Steele said:
Are you using Replace in a query or in VBA code?

If you're using it in a query, open the query in Design view, then select
SQL View from the View menu. Copy what's shown there into your reply.

If you change the vbCrLf to just vbLf in your code, it won't read properly
in Access: you'll get a small rectangle rather than a new line.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
Doug I'm sorry I have no idea what the SQL is - tell me how to find out
and
I will. I read the help file on SQL types and still have no idea.

I think I have come up with something that the boss can use that will
satisfy her - I have finally got the entire field exporting to excel which
does enough for her, but now my curiousity is taking over of course.

Let me regress a bit - I have a field in a table that is populated by
other
fields as they are input on a form. The code behind this also adds blank
lines to make this field "look nice." This is a memo field and when the
report and exported to excel to send to our distributors, the data is cut
off
mid stream. This field on the report was set to "no" to expansion. I
changed the field to "yes" allow expansion and the full information now is
on
the report in that field. But when I export that report to excel the
field
is cut off about mid way.
So my problem is I have a report in access that when exported to excel
this
field is cut off and not all information is sent to excel.
If I export from the query that this report is ran from I can get the all
the data for that field exported, but the little square codes that are at
the
end of each of the three statements that are put in this field (what I
think
are control returns) are sent with the data and the data is of course
spread
out with this formatting.
The following is the code that I found in the table for that field that is
getting populated - I guess maybe the problem is with the vbCrLf
statements?
Is that what I need to remove at the query? - thanks

Left(Me.CatalogNum, 4)
If strCatNum = "A300" Or strCatNum = "A301" Or strCatNum = "A302" Or
strCatNum = "A303" Or strCatNum = "A304" Or strCatNum = "A305" Then
Me.ProdProcedures = "Antibody was affinity purified using an
epitope specific to " & [Target] & _
" immobilized on solid support." & vbCrLf & vbCrLf & "The
epitope recognized by " & [CatalogNum] & _
" maps to a region between residue ?? and ?? of ?? using the
numbering given in entry ?? (GeneID ??)." & _
vbCrLf & vbCrLf & "Antibody concentration was determined by
extinction coefficient: " & _
"absorbance at 280 nm of 1.4 equals 1.0 mg of IgG."

Thanks so much
Delma




Douglas J. Steele said:
What's the SQL of your query?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


no that doesn't do it - I've also tried
replace([myfield], Chr(13) & Chr(10), Chr(32) - also used " " rather
than
chr(32)
replace([myfield], Chr(13) + Chr(10), Chr(32)
replace(([myfield], (Chr(13) & Chr(10)), (Chr(32)))
this is the only formula that I don't get a syntax formula error on and
I
get a syntax comma error on it:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10)," ")
notice the spaces have been removed when I click off or field and try
to
run
the query.


:

Is your computer set for a locale that uses ; (semi-colon) as the list
separator rather than , (comma)?

Try:

Replace([MyField]; Chr(13) & Chr(10); " ")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Douglas,

I typed this in just as it reads and I'm getting a syntax error
reading
"syntax error (comma) in query expression....." I have tried both
of
your
suggested lines putting them in the field row of my query and get
this
same
thing both times. Any suggestions?
thanks
Delma

:

Yes, Chr(13) is the Carriage Return, Chr(10) is the Line Feed. (If
you
were
doing it in VBA, as opposed to in a query, you could use the
intrinisic
constant vbCrLf)

For a field named ProductionProcedure, you'd put
Replace([ProductionProcedure], Chr(13) & Chr(10), " ") instead of
just
ProductionProcedure in the Field row of the query grid.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Do I put this code in the query criteria for that field? If I
want
to
remove
the returns all together what would my line look like? I am not
familiar
enough with this to know what to put in the variables - so my
field
is
ProductionProcedure - would my line be
replace[ProductionProcedure],
Chr(13)
& Chr(10), " ") - are the Chr(13) & Chr(10) the codes for the
carriage
return/line feed codes?

thanks so much for your help
Delma

:

Create a query that replaces the Carriage Return/Line Feed
Access
uses
with
just a Line Feed (which is all Excel requires), and export the
query
rather
than the table:

Replace([MyField], Chr(13) & Chr(10), Chr(10))

If that doesn't work, try replacing the Carriage Return/Line
Feed
with
a
space:

Replace([MyField], Chr(13) & Chr(10), " ")

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I am trying to export data from access that has control returns
in
the
basic
format of the field. When data is exported to excel (or
imported
by
query
in
excel) these codes cause the data to be spread out and
sometimes
cut
off.
How can I run a query in access and export that data
completely
ingnoring
the
control returns. Or as an alternative, how can I copy fields
from
access
and
paste them into excell and have the control characters
ingnored.
Or
run a
query in excel that imports data ingnoring the codes?
 
D

Douglas J. Steele

But I don't see the Replace statement anywhere in that SQL...

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
Doug, I'm using in a query - here is the SQL info:
SELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer, tblNewProducts.ShelfLife,
tblNewProducts.ProdProcedures, tblNewProducts.SpeciesReactivity,
tblNewProducts.WB, tblNewProducts.IP, tblNewProducts.IHC,
tblNewProducts.ICC,
tblNewProducts.IF, tblNewProducts.ChIP, tblNewProducts.EMSA,
tblNewProducts.Applications, tblNewProducts.Storage,
tblNewProducts.AntibodyType, tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));


Douglas J. Steele said:
Are you using Replace in a query or in VBA code?

If you're using it in a query, open the query in Design view, then select
SQL View from the View menu. Copy what's shown there into your reply.

If you change the vbCrLf to just vbLf in your code, it won't read
properly
in Access: you'll get a small rectangle rather than a new line.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
Doug I'm sorry I have no idea what the SQL is - tell me how to find out
and
I will. I read the help file on SQL types and still have no idea.

I think I have come up with something that the boss can use that will
satisfy her - I have finally got the entire field exporting to excel
which
does enough for her, but now my curiousity is taking over of course.

Let me regress a bit - I have a field in a table that is populated by
other
fields as they are input on a form. The code behind this also adds
blank
lines to make this field "look nice." This is a memo field and when
the
report and exported to excel to send to our distributors, the data is
cut
off
mid stream. This field on the report was set to "no" to expansion. I
changed the field to "yes" allow expansion and the full information now
is
on
the report in that field. But when I export that report to excel the
field
is cut off about mid way.
So my problem is I have a report in access that when exported to excel
this
field is cut off and not all information is sent to excel.
If I export from the query that this report is ran from I can get the
all
the data for that field exported, but the little square codes that are
at
the
end of each of the three statements that are put in this field (what I
think
are control returns) are sent with the data and the data is of course
spread
out with this formatting.
The following is the code that I found in the table for that field that
is
getting populated - I guess maybe the problem is with the vbCrLf
statements?
Is that what I need to remove at the query? - thanks

Left(Me.CatalogNum, 4)
If strCatNum = "A300" Or strCatNum = "A301" Or strCatNum = "A302"
Or
strCatNum = "A303" Or strCatNum = "A304" Or strCatNum = "A305" Then
Me.ProdProcedures = "Antibody was affinity purified using an
epitope specific to " & [Target] & _
" immobilized on solid support." & vbCrLf & vbCrLf & "The
epitope recognized by " & [CatalogNum] & _
" maps to a region between residue ?? and ?? of ?? using the
numbering given in entry ?? (GeneID ??)." & _
vbCrLf & vbCrLf & "Antibody concentration was determined by
extinction coefficient: " & _
"absorbance at 280 nm of 1.4 equals 1.0 mg of IgG."

Thanks so much
Delma




:

What's the SQL of your query?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


no that doesn't do it - I've also tried
replace([myfield], Chr(13) & Chr(10), Chr(32) - also used " " rather
than
chr(32)
replace([myfield], Chr(13) + Chr(10), Chr(32)
replace(([myfield], (Chr(13) & Chr(10)), (Chr(32)))
this is the only formula that I don't get a syntax formula error on
and
I
get a syntax comma error on it:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10)," ")
notice the spaces have been removed when I click off or field and
try
to
run
the query.


:

Is your computer set for a locale that uses ; (semi-colon) as the
list
separator rather than , (comma)?

Try:

Replace([MyField]; Chr(13) & Chr(10); " ")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Douglas,

I typed this in just as it reads and I'm getting a syntax error
reading
"syntax error (comma) in query expression....." I have tried
both
of
your
suggested lines putting them in the field row of my query and get
this
same
thing both times. Any suggestions?
thanks
Delma

:

Yes, Chr(13) is the Carriage Return, Chr(10) is the Line Feed.
(If
you
were
doing it in VBA, as opposed to in a query, you could use the
intrinisic
constant vbCrLf)

For a field named ProductionProcedure, you'd put
Replace([ProductionProcedure], Chr(13) & Chr(10), " ") instead
of
just
ProductionProcedure in the Field row of the query grid.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Do I put this code in the query criteria for that field? If I
want
to
remove
the returns all together what would my line look like? I am
not
familiar
enough with this to know what to put in the variables - so my
field
is
ProductionProcedure - would my line be
replace[ProductionProcedure],
Chr(13)
& Chr(10), " ") - are the Chr(13) & Chr(10) the codes for the
carriage
return/line feed codes?

thanks so much for your help
Delma

:

Create a query that replaces the Carriage Return/Line Feed
Access
uses
with
just a Line Feed (which is all Excel requires), and export
the
query
rather
than the table:

Replace([MyField], Chr(13) & Chr(10), Chr(10))

If that doesn't work, try replacing the Carriage Return/Line
Feed
with
a
space:

Replace([MyField], Chr(13) & Chr(10), " ")

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


message
I am trying to export data from access that has control
returns
in
the
basic
format of the field. When data is exported to excel (or
imported
by
query
in
excel) these codes cause the data to be spread out and
sometimes
cut
off.
How can I run a query in access and export that data
completely
ingnoring
the
control returns. Or as an alternative, how can I copy
fields
from
access
and
paste them into excell and have the control characters
ingnored.
Or
run a
query in excel that imports data ingnoring the codes?
 
H

Horsecat

When I type in the replace statement I can't get to the SQL in order to copy
and paste it here for you. I get the error "Syntax error (comma) in query
expression 'tblNewProducts. [Replace([ProdProcedures],Chr(13) &
Chr(10),Chr(32)),Chr(13) & Chr(10),Chr(32))]

my field line reads:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10),Chr(32))
and the table line reads tblNewProducts

thanks
Delma

Douglas J. Steele said:
But I don't see the Replace statement anywhere in that SQL...

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
Doug, I'm using in a query - here is the SQL info:
SELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer, tblNewProducts.ShelfLife,
tblNewProducts.ProdProcedures, tblNewProducts.SpeciesReactivity,
tblNewProducts.WB, tblNewProducts.IP, tblNewProducts.IHC,
tblNewProducts.ICC,
tblNewProducts.IF, tblNewProducts.ChIP, tblNewProducts.EMSA,
tblNewProducts.Applications, tblNewProducts.Storage,
tblNewProducts.AntibodyType, tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));


Douglas J. Steele said:
Are you using Replace in a query or in VBA code?

If you're using it in a query, open the query in Design view, then select
SQL View from the View menu. Copy what's shown there into your reply.

If you change the vbCrLf to just vbLf in your code, it won't read
properly
in Access: you'll get a small rectangle rather than a new line.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)



Doug I'm sorry I have no idea what the SQL is - tell me how to find out
and
I will. I read the help file on SQL types and still have no idea.

I think I have come up with something that the boss can use that will
satisfy her - I have finally got the entire field exporting to excel
which
does enough for her, but now my curiousity is taking over of course.

Let me regress a bit - I have a field in a table that is populated by
other
fields as they are input on a form. The code behind this also adds
blank
lines to make this field "look nice." This is a memo field and when
the
report and exported to excel to send to our distributors, the data is
cut
off
mid stream. This field on the report was set to "no" to expansion. I
changed the field to "yes" allow expansion and the full information now
is
on
the report in that field. But when I export that report to excel the
field
is cut off about mid way.
So my problem is I have a report in access that when exported to excel
this
field is cut off and not all information is sent to excel.
If I export from the query that this report is ran from I can get the
all
the data for that field exported, but the little square codes that are
at
the
end of each of the three statements that are put in this field (what I
think
are control returns) are sent with the data and the data is of course
spread
out with this formatting.
The following is the code that I found in the table for that field that
is
getting populated - I guess maybe the problem is with the vbCrLf
statements?
Is that what I need to remove at the query? - thanks

Left(Me.CatalogNum, 4)
If strCatNum = "A300" Or strCatNum = "A301" Or strCatNum = "A302"
Or
strCatNum = "A303" Or strCatNum = "A304" Or strCatNum = "A305" Then
Me.ProdProcedures = "Antibody was affinity purified using an
epitope specific to " & [Target] & _
" immobilized on solid support." & vbCrLf & vbCrLf & "The
epitope recognized by " & [CatalogNum] & _
" maps to a region between residue ?? and ?? of ?? using the
numbering given in entry ?? (GeneID ??)." & _
vbCrLf & vbCrLf & "Antibody concentration was determined by
extinction coefficient: " & _
"absorbance at 280 nm of 1.4 equals 1.0 mg of IgG."

Thanks so much
Delma




:

What's the SQL of your query?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


no that doesn't do it - I've also tried
replace([myfield], Chr(13) & Chr(10), Chr(32) - also used " " rather
than
chr(32)
replace([myfield], Chr(13) + Chr(10), Chr(32)
replace(([myfield], (Chr(13) & Chr(10)), (Chr(32)))
this is the only formula that I don't get a syntax formula error on
and
I
get a syntax comma error on it:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10)," ")
notice the spaces have been removed when I click off or field and
try
to
run
the query.


:

Is your computer set for a locale that uses ; (semi-colon) as the
list
separator rather than , (comma)?

Try:

Replace([MyField]; Chr(13) & Chr(10); " ")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Douglas,

I typed this in just as it reads and I'm getting a syntax error
reading
"syntax error (comma) in query expression....." I have tried
both
of
your
suggested lines putting them in the field row of my query and get
this
same
thing both times. Any suggestions?
thanks
Delma

:

Yes, Chr(13) is the Carriage Return, Chr(10) is the Line Feed.
(If
you
were
doing it in VBA, as opposed to in a query, you could use the
intrinisic
constant vbCrLf)

For a field named ProductionProcedure, you'd put
Replace([ProductionProcedure], Chr(13) & Chr(10), " ") instead
of
just
ProductionProcedure in the Field row of the query grid.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Do I put this code in the query criteria for that field? If I
want
to
remove
the returns all together what would my line look like? I am
not
familiar
enough with this to know what to put in the variables - so my
field
is
ProductionProcedure - would my line be
replace[ProductionProcedure],
Chr(13)
& Chr(10), " ") - are the Chr(13) & Chr(10) the codes for the
carriage
return/line feed codes?

thanks so much for your help
Delma

:

Create a query that replaces the Carriage Return/Line Feed
Access
uses
with
just a Line Feed (which is all Excel requires), and export
the
query
rather
than the table:

Replace([MyField], Chr(13) & Chr(10), Chr(10))

If that doesn't work, try replacing the Carriage Return/Line
Feed
with
a
space:

Replace([MyField], Chr(13) & Chr(10), " ")

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


message
I am trying to export data from access that has control
returns
in
the
basic
format of the field. When data is exported to excel (or
imported
by
query
in
excel) these codes cause the data to be spread out and
sometimes
cut
off.
How can I run a query in access and export that data
completely
ingnoring
the
control returns. Or as an alternative, how can I copy
fields
from
access
and
paste them into excell and have the control characters
ingnored.
Or
run a
query in excel that imports data ingnoring the codes?
 
D

Douglas J. Steele

Replace([tblNewProduct].[ProdProcedures],Chr(13) & Chr(10),Chr(32))

The Table line should be blank.

Failing that, when you're in the SQL, change it to

SELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer, tblNewProducts.ShelfLife,
Replace(tblNewProducts.ProdProcedures, Chr(13) & Chr(10), Chr(32)),
tblNewProducts.SpeciesReactivity,
tblNewProducts.WB, tblNewProducts.IP, tblNewProducts.IHC,
tblNewProducts.ICC,
tblNewProducts.IF, tblNewProducts.ChIP, tblNewProducts.EMSA,
tblNewProducts.Applications, tblNewProducts.Storage,
tblNewProducts.AntibodyType, tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
When I type in the replace statement I can't get to the SQL in order to
copy
and paste it here for you. I get the error "Syntax error (comma) in query
expression 'tblNewProducts. [Replace([ProdProcedures],Chr(13) &
Chr(10),Chr(32)),Chr(13) & Chr(10),Chr(32))]

my field line reads:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10),Chr(32))
and the table line reads tblNewProducts

thanks
Delma

Douglas J. Steele said:
But I don't see the Replace statement anywhere in that SQL...

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
Doug, I'm using in a query - here is the SQL info:
SELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer,
tblNewProducts.ShelfLife,
tblNewProducts.ProdProcedures, tblNewProducts.SpeciesReactivity,
tblNewProducts.WB, tblNewProducts.IP, tblNewProducts.IHC,
tblNewProducts.ICC,
tblNewProducts.IF, tblNewProducts.ChIP, tblNewProducts.EMSA,
tblNewProducts.Applications, tblNewProducts.Storage,
tblNewProducts.AntibodyType, tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));


:

Are you using Replace in a query or in VBA code?

If you're using it in a query, open the query in Design view, then
select
SQL View from the View menu. Copy what's shown there into your reply.

If you change the vbCrLf to just vbLf in your code, it won't read
properly
in Access: you'll get a small rectangle rather than a new line.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)



Doug I'm sorry I have no idea what the SQL is - tell me how to find
out
and
I will. I read the help file on SQL types and still have no idea.

I think I have come up with something that the boss can use that
will
satisfy her - I have finally got the entire field exporting to excel
which
does enough for her, but now my curiousity is taking over of course.

Let me regress a bit - I have a field in a table that is populated
by
other
fields as they are input on a form. The code behind this also adds
blank
lines to make this field "look nice." This is a memo field and when
the
report and exported to excel to send to our distributors, the data
is
cut
off
mid stream. This field on the report was set to "no" to expansion.
I
changed the field to "yes" allow expansion and the full information
now
is
on
the report in that field. But when I export that report to excel
the
field
is cut off about mid way.
So my problem is I have a report in access that when exported to
excel
this
field is cut off and not all information is sent to excel.
If I export from the query that this report is ran from I can get
the
all
the data for that field exported, but the little square codes that
are
at
the
end of each of the three statements that are put in this field (what
I
think
are control returns) are sent with the data and the data is of
course
spread
out with this formatting.
The following is the code that I found in the table for that field
that
is
getting populated - I guess maybe the problem is with the vbCrLf
statements?
Is that what I need to remove at the query? - thanks

Left(Me.CatalogNum, 4)
If strCatNum = "A300" Or strCatNum = "A301" Or strCatNum =
"A302"
Or
strCatNum = "A303" Or strCatNum = "A304" Or strCatNum = "A305" Then
Me.ProdProcedures = "Antibody was affinity purified using an
epitope specific to " & [Target] & _
" immobilized on solid support." & vbCrLf & vbCrLf & "The
epitope recognized by " & [CatalogNum] & _
" maps to a region between residue ?? and ?? of ?? using
the
numbering given in entry ?? (GeneID ??)." & _
vbCrLf & vbCrLf & "Antibody concentration was determined
by
extinction coefficient: " & _
"absorbance at 280 nm of 1.4 equals 1.0 mg of IgG."

Thanks so much
Delma




:

What's the SQL of your query?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


no that doesn't do it - I've also tried
replace([myfield], Chr(13) & Chr(10), Chr(32) - also used " "
rather
than
chr(32)
replace([myfield], Chr(13) + Chr(10), Chr(32)
replace(([myfield], (Chr(13) & Chr(10)), (Chr(32)))
this is the only formula that I don't get a syntax formula error
on
and
I
get a syntax comma error on it:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10)," ")
notice the spaces have been removed when I click off or field and
try
to
run
the query.


:

Is your computer set for a locale that uses ; (semi-colon) as
the
list
separator rather than , (comma)?

Try:

Replace([MyField]; Chr(13) & Chr(10); " ")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Douglas,

I typed this in just as it reads and I'm getting a syntax
error
reading
"syntax error (comma) in query expression....." I have tried
both
of
your
suggested lines putting them in the field row of my query and
get
this
same
thing both times. Any suggestions?
thanks
Delma

:

Yes, Chr(13) is the Carriage Return, Chr(10) is the Line
Feed.
(If
you
were
doing it in VBA, as opposed to in a query, you could use the
intrinisic
constant vbCrLf)

For a field named ProductionProcedure, you'd put
Replace([ProductionProcedure], Chr(13) & Chr(10), " ")
instead
of
just
ProductionProcedure in the Field row of the query grid.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


message
Do I put this code in the query criteria for that field?
If I
want
to
remove
the returns all together what would my line look like? I
am
not
familiar
enough with this to know what to put in the variables - so
my
field
is
ProductionProcedure - would my line be
replace[ProductionProcedure],
Chr(13)
& Chr(10), " ") - are the Chr(13) & Chr(10) the codes for
the
carriage
return/line feed codes?

thanks so much for your help
Delma

:

Create a query that replaces the Carriage Return/Line Feed
Access
uses
with
just a Line Feed (which is all Excel requires), and export
the
query
rather
than the table:

Replace([MyField], Chr(13) & Chr(10), Chr(10))

If that doesn't work, try replacing the Carriage
Return/Line
Feed
with
a
space:

Replace([MyField], Chr(13) & Chr(10), " ")

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


message
I am trying to export data from access that has control
returns
in
the
basic
format of the field. When data is exported to excel (or
imported
by
query
in
excel) these codes cause the data to be spread out and
sometimes
cut
off.
How can I run a query in access and export that data
completely
ingnoring
the
control returns. Or as an alternative, how can I copy
fields
from
access
and
paste them into excell and have the control characters
ingnored.
Or
run a
query in excel that imports data ingnoring the codes?
 
H

Horsecat

Doug,

I tried both and both times the ProdProcedures field was not brought down
with my data when I ran the query.

When I type in your statement in the field line and leave table field blank
my SQL looks like this:
ELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer, tblNewProducts.ShelfLife,
Replace([tblNewProducts].[ProdProcedures],Chr(13) & Chr(10),Chr(32)) AS
Expr1, tblNewProducts.SpeciesReactivity, tblNewProducts.WB,
tblNewProducts.IP, tblNewProducts.IHC, tblNewProducts.ICC, tblNewProducts.IF,
tblNewProducts.ChIP, tblNewProducts.EMSA, tblNewProducts.Applications,
tblNewProducts.Storage, tblNewProducts.AntibodyType, tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));

When I type in the information as you gave me in SQL view same thing happens
- my SQL now looks like:
SELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer, tblNewProducts.ShelfLife,
Replace(tblNewProducts.ProdProcedures,Chr(13) & Chr(10),Chr(32)),
tblNewProducts.SpeciesReactivity, tblNewProducts.WB, tblNewProducts.IP,
tblNewProducts.IHC, tblNewProducts.ICC, tblNewProducts.IF,
tblNewProducts.ChIP, tblNewProducts.EMSA, tblNewProducts.Applications,
tblNewProducts.Storage, tblNewProducts.AntibodyType, tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));

and again ProProcedures field not pulled down in query.
If I select the table in the table line I get a "enter parameter value"
screen - I trield typing in ProdProcedures, NewProducts, * and don't get the
field.

thanks
Delma

Douglas J. Steele said:
Replace([tblNewProduct].[ProdProcedures],Chr(13) & Chr(10),Chr(32))

The Table line should be blank.

Failing that, when you're in the SQL, change it to

SELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer, tblNewProducts.ShelfLife,
Replace(tblNewProducts.ProdProcedures, Chr(13) & Chr(10), Chr(32)),
tblNewProducts.SpeciesReactivity,
tblNewProducts.WB, tblNewProducts.IP, tblNewProducts.IHC,
tblNewProducts.ICC,
tblNewProducts.IF, tblNewProducts.ChIP, tblNewProducts.EMSA,
tblNewProducts.Applications, tblNewProducts.Storage,
tblNewProducts.AntibodyType, tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
When I type in the replace statement I can't get to the SQL in order to
copy
and paste it here for you. I get the error "Syntax error (comma) in query
expression 'tblNewProducts. [Replace([ProdProcedures],Chr(13) &
Chr(10),Chr(32)),Chr(13) & Chr(10),Chr(32))]

my field line reads:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10),Chr(32))
and the table line reads tblNewProducts

thanks
Delma

Douglas J. Steele said:
But I don't see the Replace statement anywhere in that SQL...

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Doug, I'm using in a query - here is the SQL info:
SELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer,
tblNewProducts.ShelfLife,
tblNewProducts.ProdProcedures, tblNewProducts.SpeciesReactivity,
tblNewProducts.WB, tblNewProducts.IP, tblNewProducts.IHC,
tblNewProducts.ICC,
tblNewProducts.IF, tblNewProducts.ChIP, tblNewProducts.EMSA,
tblNewProducts.Applications, tblNewProducts.Storage,
tblNewProducts.AntibodyType, tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));


:

Are you using Replace in a query or in VBA code?

If you're using it in a query, open the query in Design view, then
select
SQL View from the View menu. Copy what's shown there into your reply.

If you change the vbCrLf to just vbLf in your code, it won't read
properly
in Access: you'll get a small rectangle rather than a new line.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)



Doug I'm sorry I have no idea what the SQL is - tell me how to find
out
and
I will. I read the help file on SQL types and still have no idea.

I think I have come up with something that the boss can use that
will
satisfy her - I have finally got the entire field exporting to excel
which
does enough for her, but now my curiousity is taking over of course.

Let me regress a bit - I have a field in a table that is populated
by
other
fields as they are input on a form. The code behind this also adds
blank
lines to make this field "look nice." This is a memo field and when
the
report and exported to excel to send to our distributors, the data
is
cut
off
mid stream. This field on the report was set to "no" to expansion.
I
changed the field to "yes" allow expansion and the full information
now
is
on
the report in that field. But when I export that report to excel
the
field
is cut off about mid way.
So my problem is I have a report in access that when exported to
excel
this
field is cut off and not all information is sent to excel.
If I export from the query that this report is ran from I can get
the
all
the data for that field exported, but the little square codes that
are
at
the
end of each of the three statements that are put in this field (what
I
think
are control returns) are sent with the data and the data is of
course
spread
out with this formatting.
The following is the code that I found in the table for that field
that
is
getting populated - I guess maybe the problem is with the vbCrLf
statements?
Is that what I need to remove at the query? - thanks

Left(Me.CatalogNum, 4)
If strCatNum = "A300" Or strCatNum = "A301" Or strCatNum =
"A302"
Or
strCatNum = "A303" Or strCatNum = "A304" Or strCatNum = "A305" Then
Me.ProdProcedures = "Antibody was affinity purified using an
epitope specific to " & [Target] & _
" immobilized on solid support." & vbCrLf & vbCrLf & "The
epitope recognized by " & [CatalogNum] & _
" maps to a region between residue ?? and ?? of ?? using
the
numbering given in entry ?? (GeneID ??)." & _
vbCrLf & vbCrLf & "Antibody concentration was determined
by
extinction coefficient: " & _
"absorbance at 280 nm of 1.4 equals 1.0 mg of IgG."

Thanks so much
Delma




:

What's the SQL of your query?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


no that doesn't do it - I've also tried
replace([myfield], Chr(13) & Chr(10), Chr(32) - also used " "
rather
than
chr(32)
replace([myfield], Chr(13) + Chr(10), Chr(32)
replace(([myfield], (Chr(13) & Chr(10)), (Chr(32)))
this is the only formula that I don't get a syntax formula error
on
and
I
get a syntax comma error on it:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10)," ")
notice the spaces have been removed when I click off or field and
try
to
run
the query.


:

Is your computer set for a locale that uses ; (semi-colon) as
the
list
separator rather than , (comma)?

Try:

Replace([MyField]; Chr(13) & Chr(10); " ")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Douglas,

I typed this in just as it reads and I'm getting a syntax
error
reading
"syntax error (comma) in query expression....." I have tried
both
of
your
suggested lines putting them in the field row of my query and
get
this
same
thing both times. Any suggestions?
thanks
Delma

:

Yes, Chr(13) is the Carriage Return, Chr(10) is the Line
Feed.
(If
you
were
doing it in VBA, as opposed to in a query, you could use the
intrinisic
constant vbCrLf)

For a field named ProductionProcedure, you'd put
Replace([ProductionProcedure], Chr(13) & Chr(10), " ")
instead
of
just
ProductionProcedure in the Field row of the query grid.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


message
Do I put this code in the query criteria for that field?
If I
want
to
remove
the returns all together what would my line look like? I
am
not
familiar
enough with this to know what to put in the variables - so
my
field
is
ProductionProcedure - would my line be
replace[ProductionProcedure],
Chr(13)
& Chr(10), " ") - are the Chr(13) & Chr(10) the codes for
the
carriage
return/line feed codes?

thanks so much for your help
Delma

:

Create a query that replaces the Carriage Return/Line Feed
Access
uses
with
just a Line Feed (which is all Excel requires), and export
 
D

Douglas J. Steele

Exactly how is the parameter labelled? Right about the input box, there
should be a name. Odds are you mistyped the field name, so Access doesn't
know what it's supposed to retrieve.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
Doug,

I tried both and both times the ProdProcedures field was not brought down
with my data when I ran the query.

When I type in your statement in the field line and leave table field
blank
my SQL looks like this:
ELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer, tblNewProducts.ShelfLife,
Replace([tblNewProducts].[ProdProcedures],Chr(13) & Chr(10),Chr(32)) AS
Expr1, tblNewProducts.SpeciesReactivity, tblNewProducts.WB,
tblNewProducts.IP, tblNewProducts.IHC, tblNewProducts.ICC,
tblNewProducts.IF,
tblNewProducts.ChIP, tblNewProducts.EMSA, tblNewProducts.Applications,
tblNewProducts.Storage, tblNewProducts.AntibodyType,
tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));

When I type in the information as you gave me in SQL view same thing
happens
- my SQL now looks like:
SELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer, tblNewProducts.ShelfLife,
Replace(tblNewProducts.ProdProcedures,Chr(13) & Chr(10),Chr(32)),
tblNewProducts.SpeciesReactivity, tblNewProducts.WB, tblNewProducts.IP,
tblNewProducts.IHC, tblNewProducts.ICC, tblNewProducts.IF,
tblNewProducts.ChIP, tblNewProducts.EMSA, tblNewProducts.Applications,
tblNewProducts.Storage, tblNewProducts.AntibodyType,
tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));

and again ProProcedures field not pulled down in query.
If I select the table in the table line I get a "enter parameter value"
screen - I trield typing in ProdProcedures, NewProducts, * and don't get
the
field.

thanks
Delma

Douglas J. Steele said:
Replace([tblNewProduct].[ProdProcedures],Chr(13) & Chr(10),Chr(32))

The Table line should be blank.

Failing that, when you're in the SQL, change it to

SELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer, tblNewProducts.ShelfLife,
Replace(tblNewProducts.ProdProcedures, Chr(13) & Chr(10), Chr(32)),
tblNewProducts.SpeciesReactivity,
tblNewProducts.WB, tblNewProducts.IP, tblNewProducts.IHC,
tblNewProducts.ICC,
tblNewProducts.IF, tblNewProducts.ChIP, tblNewProducts.EMSA,
tblNewProducts.Applications, tblNewProducts.Storage,
tblNewProducts.AntibodyType, tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
When I type in the replace statement I can't get to the SQL in order to
copy
and paste it here for you. I get the error "Syntax error (comma) in
query
expression 'tblNewProducts. [Replace([ProdProcedures],Chr(13) &
Chr(10),Chr(32)),Chr(13) & Chr(10),Chr(32))]

my field line reads:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10),Chr(32))
and the table line reads tblNewProducts

thanks
Delma

:

But I don't see the Replace statement anywhere in that SQL...

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Doug, I'm using in a query - here is the SQL info:
SELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer,
tblNewProducts.ShelfLife,
tblNewProducts.ProdProcedures, tblNewProducts.SpeciesReactivity,
tblNewProducts.WB, tblNewProducts.IP, tblNewProducts.IHC,
tblNewProducts.ICC,
tblNewProducts.IF, tblNewProducts.ChIP, tblNewProducts.EMSA,
tblNewProducts.Applications, tblNewProducts.Storage,
tblNewProducts.AntibodyType, tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));


:

Are you using Replace in a query or in VBA code?

If you're using it in a query, open the query in Design view, then
select
SQL View from the View menu. Copy what's shown there into your
reply.

If you change the vbCrLf to just vbLf in your code, it won't read
properly
in Access: you'll get a small rectangle rather than a new line.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)



Doug I'm sorry I have no idea what the SQL is - tell me how to
find
out
and
I will. I read the help file on SQL types and still have no
idea.

I think I have come up with something that the boss can use that
will
satisfy her - I have finally got the entire field exporting to
excel
which
does enough for her, but now my curiousity is taking over of
course.

Let me regress a bit - I have a field in a table that is
populated
by
other
fields as they are input on a form. The code behind this also
adds
blank
lines to make this field "look nice." This is a memo field and
when
the
report and exported to excel to send to our distributors, the
data
is
cut
off
mid stream. This field on the report was set to "no" to
expansion.
I
changed the field to "yes" allow expansion and the full
information
now
is
on
the report in that field. But when I export that report to excel
the
field
is cut off about mid way.
So my problem is I have a report in access that when exported to
excel
this
field is cut off and not all information is sent to excel.
If I export from the query that this report is ran from I can get
the
all
the data for that field exported, but the little square codes
that
are
at
the
end of each of the three statements that are put in this field
(what
I
think
are control returns) are sent with the data and the data is of
course
spread
out with this formatting.
The following is the code that I found in the table for that
field
that
is
getting populated - I guess maybe the problem is with the vbCrLf
statements?
Is that what I need to remove at the query? - thanks

Left(Me.CatalogNum, 4)
If strCatNum = "A300" Or strCatNum = "A301" Or strCatNum =
"A302"
Or
strCatNum = "A303" Or strCatNum = "A304" Or strCatNum = "A305"
Then
Me.ProdProcedures = "Antibody was affinity purified using
an
epitope specific to " & [Target] & _
" immobilized on solid support." & vbCrLf & vbCrLf &
"The
epitope recognized by " & [CatalogNum] & _
" maps to a region between residue ?? and ?? of ??
using
the
numbering given in entry ?? (GeneID ??)." & _
vbCrLf & vbCrLf & "Antibody concentration was
determined
by
extinction coefficient: " & _
"absorbance at 280 nm of 1.4 equals 1.0 mg of IgG."

Thanks so much
Delma




:

What's the SQL of your query?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


no that doesn't do it - I've also tried
replace([myfield], Chr(13) & Chr(10), Chr(32) - also used " "
rather
than
chr(32)
replace([myfield], Chr(13) + Chr(10), Chr(32)
replace(([myfield], (Chr(13) & Chr(10)), (Chr(32)))
this is the only formula that I don't get a syntax formula
error
on
and
I
get a syntax comma error on it:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10)," ")
notice the spaces have been removed when I click off or field
and
try
to
run
the query.


:

Is your computer set for a locale that uses ; (semi-colon) as
the
list
separator rather than , (comma)?

Try:

Replace([MyField]; Chr(13) & Chr(10); " ")


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


message
Douglas,

I typed this in just as it reads and I'm getting a syntax
error
reading
"syntax error (comma) in query expression....." I have
tried
both
of
your
suggested lines putting them in the field row of my query
and
get
this
same
thing both times. Any suggestions?
thanks
Delma

:

Yes, Chr(13) is the Carriage Return, Chr(10) is the Line
Feed.
(If
you
were
doing it in VBA, as opposed to in a query, you could use
the
intrinisic
constant vbCrLf)

For a field named ProductionProcedure, you'd put
Replace([ProductionProcedure], Chr(13) & Chr(10), " ")
instead
of
just
ProductionProcedure in the Field row of the query grid.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


message
Do I put this code in the query criteria for that field?
If I
want
to
remove
the returns all together what would my line look like?
I
am
not
familiar
enough with this to know what to put in the variables -
so
my
field
is
ProductionProcedure - would my line be
replace[ProductionProcedure],
Chr(13)
& Chr(10), " ") - are the Chr(13) & Chr(10) the codes
for
the
carriage
return/line feed codes?

thanks so much for your help
Delma

:

Create a query that replaces the Carriage Return/Line
Feed
Access
uses
with
just a Line Feed (which is all Excel requires), and
export
 
H

Horsecat

Doug -

table name is "tblNewProducts
Field is "ProdProcedures"
just like I have them typed
when I run the query without a replace statement I get the data for the
field and no input box like I should - it is only when I duplicate the table
name in the "field name" and "table name" rows of the query (or in SQL line
and table name field) that I get the input box
otherwise I get no data at all

thanks
delma


Douglas J. Steele said:
Exactly how is the parameter labelled? Right about the input box, there
should be a name. Odds are you mistyped the field name, so Access doesn't
know what it's supposed to retrieve.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
Doug,

I tried both and both times the ProdProcedures field was not brought down
with my data when I ran the query.

When I type in your statement in the field line and leave table field
blank
my SQL looks like this:
ELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer, tblNewProducts.ShelfLife,
Replace([tblNewProducts].[ProdProcedures],Chr(13) & Chr(10),Chr(32)) AS
Expr1, tblNewProducts.SpeciesReactivity, tblNewProducts.WB,
tblNewProducts.IP, tblNewProducts.IHC, tblNewProducts.ICC,
tblNewProducts.IF,
tblNewProducts.ChIP, tblNewProducts.EMSA, tblNewProducts.Applications,
tblNewProducts.Storage, tblNewProducts.AntibodyType,
tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));

When I type in the information as you gave me in SQL view same thing
happens
- my SQL now looks like:
SELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer, tblNewProducts.ShelfLife,
Replace(tblNewProducts.ProdProcedures,Chr(13) & Chr(10),Chr(32)),
tblNewProducts.SpeciesReactivity, tblNewProducts.WB, tblNewProducts.IP,
tblNewProducts.IHC, tblNewProducts.ICC, tblNewProducts.IF,
tblNewProducts.ChIP, tblNewProducts.EMSA, tblNewProducts.Applications,
tblNewProducts.Storage, tblNewProducts.AntibodyType,
tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));

and again ProProcedures field not pulled down in query.
If I select the table in the table line I get a "enter parameter value"
screen - I trield typing in ProdProcedures, NewProducts, * and don't get
the
field.

thanks
Delma

Douglas J. Steele said:
Replace([tblNewProduct].[ProdProcedures],Chr(13) & Chr(10),Chr(32))

The Table line should be blank.

Failing that, when you're in the SQL, change it to

SELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer, tblNewProducts.ShelfLife,
Replace(tblNewProducts.ProdProcedures, Chr(13) & Chr(10), Chr(32)),
tblNewProducts.SpeciesReactivity,
tblNewProducts.WB, tblNewProducts.IP, tblNewProducts.IHC,
tblNewProducts.ICC,
tblNewProducts.IF, tblNewProducts.ChIP, tblNewProducts.EMSA,
tblNewProducts.Applications, tblNewProducts.Storage,
tblNewProducts.AntibodyType, tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


When I type in the replace statement I can't get to the SQL in order to
copy
and paste it here for you. I get the error "Syntax error (comma) in
query
expression 'tblNewProducts. [Replace([ProdProcedures],Chr(13) &
Chr(10),Chr(32)),Chr(13) & Chr(10),Chr(32))]

my field line reads:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10),Chr(32))
and the table line reads tblNewProducts

thanks
Delma

:

But I don't see the Replace statement anywhere in that SQL...

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Doug, I'm using in a query - here is the SQL info:
SELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer,
tblNewProducts.ShelfLife,
tblNewProducts.ProdProcedures, tblNewProducts.SpeciesReactivity,
tblNewProducts.WB, tblNewProducts.IP, tblNewProducts.IHC,
tblNewProducts.ICC,
tblNewProducts.IF, tblNewProducts.ChIP, tblNewProducts.EMSA,
tblNewProducts.Applications, tblNewProducts.Storage,
tblNewProducts.AntibodyType, tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));


:

Are you using Replace in a query or in VBA code?

If you're using it in a query, open the query in Design view, then
select
SQL View from the View menu. Copy what's shown there into your
reply.

If you change the vbCrLf to just vbLf in your code, it won't read
properly
in Access: you'll get a small rectangle rather than a new line.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)



Doug I'm sorry I have no idea what the SQL is - tell me how to
find
out
and
I will. I read the help file on SQL types and still have no
idea.

I think I have come up with something that the boss can use that
will
satisfy her - I have finally got the entire field exporting to
excel
which
does enough for her, but now my curiousity is taking over of
course.

Let me regress a bit - I have a field in a table that is
populated
by
other
fields as they are input on a form. The code behind this also
adds
blank
lines to make this field "look nice." This is a memo field and
when
the
report and exported to excel to send to our distributors, the
data
is
cut
off
mid stream. This field on the report was set to "no" to
expansion.
I
changed the field to "yes" allow expansion and the full
information
now
is
on
the report in that field. But when I export that report to excel
the
field
is cut off about mid way.
So my problem is I have a report in access that when exported to
excel
this
field is cut off and not all information is sent to excel.
If I export from the query that this report is ran from I can get
the
all
the data for that field exported, but the little square codes
that
are
at
the
end of each of the three statements that are put in this field
(what
I
think
are control returns) are sent with the data and the data is of
course
spread
out with this formatting.
The following is the code that I found in the table for that
field
that
is
getting populated - I guess maybe the problem is with the vbCrLf
statements?
Is that what I need to remove at the query? - thanks

Left(Me.CatalogNum, 4)
If strCatNum = "A300" Or strCatNum = "A301" Or strCatNum =
"A302"
Or
strCatNum = "A303" Or strCatNum = "A304" Or strCatNum = "A305"
Then
Me.ProdProcedures = "Antibody was affinity purified using
an
epitope specific to " & [Target] & _
" immobilized on solid support." & vbCrLf & vbCrLf &
"The
epitope recognized by " & [CatalogNum] & _
" maps to a region between residue ?? and ?? of ??
using
the
numbering given in entry ?? (GeneID ??)." & _
vbCrLf & vbCrLf & "Antibody concentration was
determined
by
extinction coefficient: " & _
"absorbance at 280 nm of 1.4 equals 1.0 mg of IgG."

Thanks so much
Delma




:

What's the SQL of your query?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


no that doesn't do it - I've also tried
replace([myfield], Chr(13) & Chr(10), Chr(32) - also used " "
rather
than
chr(32)
replace([myfield], Chr(13) + Chr(10), Chr(32)
replace(([myfield], (Chr(13) & Chr(10)), (Chr(32)))
this is the only formula that I don't get a syntax formula
error
on
and
I
get a syntax comma error on it:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10)," ")
notice the spaces have been removed when I click off or field
and
try
to
run
the query.


:

Is your computer set for a locale that uses ; (semi-colon) as
the
list
separator rather than , (comma)?

Try:

Replace([MyField]; Chr(13) & Chr(10); " ")
 
D

Douglas J. Steele

As I said before, the "Table Name" row should be blank in the graphical
query builder.

I'm afraid I have no more advice to give you: what I've suggested works for
me, and for others to whom I've suggested it.

Good luck!

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
Doug -

table name is "tblNewProducts
Field is "ProdProcedures"
just like I have them typed
when I run the query without a replace statement I get the data for the
field and no input box like I should - it is only when I duplicate the
table
name in the "field name" and "table name" rows of the query (or in SQL
line
and table name field) that I get the input box
otherwise I get no data at all

thanks
delma


Douglas J. Steele said:
Exactly how is the parameter labelled? Right about the input box, there
should be a name. Odds are you mistyped the field name, so Access doesn't
know what it's supposed to retrieve.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Horsecat said:
Doug,

I tried both and both times the ProdProcedures field was not brought
down
with my data when I ran the query.

When I type in your statement in the field line and leave table field
blank
my SQL looks like this:
ELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer,
tblNewProducts.ShelfLife,
Replace([tblNewProducts].[ProdProcedures],Chr(13) & Chr(10),Chr(32)) AS
Expr1, tblNewProducts.SpeciesReactivity, tblNewProducts.WB,
tblNewProducts.IP, tblNewProducts.IHC, tblNewProducts.ICC,
tblNewProducts.IF,
tblNewProducts.ChIP, tblNewProducts.EMSA, tblNewProducts.Applications,
tblNewProducts.Storage, tblNewProducts.AntibodyType,
tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));

When I type in the information as you gave me in SQL view same thing
happens
- my SQL now looks like:
SELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer,
tblNewProducts.ShelfLife,
Replace(tblNewProducts.ProdProcedures,Chr(13) & Chr(10),Chr(32)),
tblNewProducts.SpeciesReactivity, tblNewProducts.WB, tblNewProducts.IP,
tblNewProducts.IHC, tblNewProducts.ICC, tblNewProducts.IF,
tblNewProducts.ChIP, tblNewProducts.EMSA, tblNewProducts.Applications,
tblNewProducts.Storage, tblNewProducts.AntibodyType,
tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));

and again ProProcedures field not pulled down in query.
If I select the table in the table line I get a "enter parameter value"
screen - I trield typing in ProdProcedures, NewProducts, * and don't
get
the
field.

thanks
Delma

:

Replace([tblNewProduct].[ProdProcedures],Chr(13) & Chr(10),Chr(32))

The Table line should be blank.

Failing that, when you're in the SQL, change it to

SELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer,
tblNewProducts.ShelfLife,
Replace(tblNewProducts.ProdProcedures, Chr(13) & Chr(10), Chr(32)),
tblNewProducts.SpeciesReactivity,
tblNewProducts.WB, tblNewProducts.IP, tblNewProducts.IHC,
tblNewProducts.ICC,
tblNewProducts.IF, tblNewProducts.ChIP, tblNewProducts.EMSA,
tblNewProducts.Applications, tblNewProducts.Storage,
tblNewProducts.AntibodyType, tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


When I type in the replace statement I can't get to the SQL in order
to
copy
and paste it here for you. I get the error "Syntax error (comma) in
query
expression 'tblNewProducts. [Replace([ProdProcedures],Chr(13) &
Chr(10),Chr(32)),Chr(13) & Chr(10),Chr(32))]

my field line reads:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10),Chr(32))
and the table line reads tblNewProducts

thanks
Delma

:

But I don't see the Replace statement anywhere in that SQL...

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Doug, I'm using in a query - here is the SQL info:
SELECT tblNewProducts.CatalogNum, tblNewProducts.DateEntered,
tblNewProducts.Desc, tblNewProducts.Host, tblNewProducts.Amount,
tblNewProducts.ProdSize, tblNewProducts.Buffer,
tblNewProducts.ShelfLife,
tblNewProducts.ProdProcedures, tblNewProducts.SpeciesReactivity,
tblNewProducts.WB, tblNewProducts.IP, tblNewProducts.IHC,
tblNewProducts.ICC,
tblNewProducts.IF, tblNewProducts.ChIP, tblNewProducts.EMSA,
tblNewProducts.Applications, tblNewProducts.Storage,
tblNewProducts.AntibodyType, tblNewProducts.Format,
tblNewProducts.CurrentPrice, tblNewProducts.AltNames,
tblNewProducts.Discontinued
FROM tblNewProducts
WHERE (((tblNewProducts.Discontinued)=No));


:

Are you using Replace in a query or in VBA code?

If you're using it in a query, open the query in Design view,
then
select
SQL View from the View menu. Copy what's shown there into your
reply.

If you change the vbCrLf to just vbLf in your code, it won't
read
properly
in Access: you'll get a small rectangle rather than a new line.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)



Doug I'm sorry I have no idea what the SQL is - tell me how to
find
out
and
I will. I read the help file on SQL types and still have no
idea.

I think I have come up with something that the boss can use
that
will
satisfy her - I have finally got the entire field exporting to
excel
which
does enough for her, but now my curiousity is taking over of
course.

Let me regress a bit - I have a field in a table that is
populated
by
other
fields as they are input on a form. The code behind this also
adds
blank
lines to make this field "look nice." This is a memo field
and
when
the
report and exported to excel to send to our distributors, the
data
is
cut
off
mid stream. This field on the report was set to "no" to
expansion.
I
changed the field to "yes" allow expansion and the full
information
now
is
on
the report in that field. But when I export that report to
excel
the
field
is cut off about mid way.
So my problem is I have a report in access that when exported
to
excel
this
field is cut off and not all information is sent to excel.
If I export from the query that this report is ran from I can
get
the
all
the data for that field exported, but the little square codes
that
are
at
the
end of each of the three statements that are put in this field
(what
I
think
are control returns) are sent with the data and the data is of
course
spread
out with this formatting.
The following is the code that I found in the table for that
field
that
is
getting populated - I guess maybe the problem is with the
vbCrLf
statements?
Is that what I need to remove at the query? - thanks

Left(Me.CatalogNum, 4)
If strCatNum = "A300" Or strCatNum = "A301" Or strCatNum
=
"A302"
Or
strCatNum = "A303" Or strCatNum = "A304" Or strCatNum = "A305"
Then
Me.ProdProcedures = "Antibody was affinity purified
using
an
epitope specific to " & [Target] & _
" immobilized on solid support." & vbCrLf & vbCrLf
&
"The
epitope recognized by " & [CatalogNum] & _
" maps to a region between residue ?? and ?? of ??
using
the
numbering given in entry ?? (GeneID ??)." & _
vbCrLf & vbCrLf & "Antibody concentration was
determined
by
extinction coefficient: " & _
"absorbance at 280 nm of 1.4 equals 1.0 mg of IgG."

Thanks so much
Delma




:

What's the SQL of your query?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


message
no that doesn't do it - I've also tried
replace([myfield], Chr(13) & Chr(10), Chr(32) - also used "
"
rather
than
chr(32)
replace([myfield], Chr(13) + Chr(10), Chr(32)
replace(([myfield], (Chr(13) & Chr(10)), (Chr(32)))
this is the only formula that I don't get a syntax formula
error
on
and
I
get a syntax comma error on it:
Expr1: Replace([ProdProcedures],Chr(13) & Chr(10)," ")
notice the spaces have been removed when I click off or
field
and
try
to
run
the query.


:

Is your computer set for a locale that uses ; (semi-colon)
as
the
list
separator rather than , (comma)?

Try:

Replace([MyField]; 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