Access reports in detail section how do I remove carrage return

G

Guest

In the detail section of my report I have the following data displayed

BEECH-NUT
Baby Foods in jars without salicylate
Rice Cereal with Bananas
Toddler Foods in jars without salicylate
STAGES
Barley Cereal
Mixed Cerea|
Pear Juice


And would prefer to have the format as follows

BEECH-NUT Baby Foods in jars without salicylate, Rice Cereal with Bananas,
Toddler Foods in jars without salicylate
STAGES Barley Cereal Mixed Cereal,
Pear Juice

Basically how could I remove the carrage return line feed and replace it
with a comma with the exception of the last record
 
F

fredg

In the detail section of my report I have the following data displayed

BEECH-NUT
Baby Foods in jars without salicylate
Rice Cereal with Bananas
Toddler Foods in jars without salicylate
STAGES
Barley Cereal
Mixed Cerea|
Pear Juice

And would prefer to have the format as follows

BEECH-NUT Baby Foods in jars without salicylate, Rice Cereal with Bananas,
Toddler Foods in jars without salicylate
STAGES Barley Cereal Mixed Cereal,
Pear Juice

Basically how could I remove the carrage return line feed and replace it
with a comma with the exception of the last record

If you have Access 2000 or newer....
You can create a User Defined function.

Public Function RemoveCR(StringIn As String) As String
StringIn = Replace(StringIn, Chr(13) & Chr(10), ", ")
RemoveCR = StringIn
End function

Call it from an unbound control on the report:
=RemoveCr([FieldName])
 

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

Similar Threads


Top