Assistance fixing carriage returns

R

Rachel Garrett

I have carriage returns that used to show up in Excel, but now show up
as vertical bars or boxes in Access. How do I find out what ASCII code
goes with those boxes, so I can do a REPLACE?

Thanks,
Rachel
 
J

John Spencer

Probably those are Chr(10) (Line Feeds).
Try replacing with Chr(13) & Chr(10) (Carriage Return plus Line Feed).

UPDATE YourTable
SET YourField = Replace([YourField],Chr(10),Chr(13) & Chr(10))
WHERE YourField Like "*" & Chr(10) & "*"

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 
J

John W. Vinson

I have carriage returns that used to show up in Excel, but now show up
as vertical bars or boxes in Access. How do I find out what ASCII code
goes with those boxes, so I can do a REPLACE?

Thanks,
Rachel

It's almost certainly a linefeed, Chr(10). Make a backup of the database and
run a query updating the field to

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

to replace the linefeed with a carriage return-linefeed pair.
 

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