Access reports in detail section how do I remove carrage return

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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])
 
Back
Top