replace line breaks in memo field

S

shank

I want to replace the line breaks and/or carriage returns in a memo field.
I know how to use the REPLACE function.
How do I represent line breaks or carriage returns in the following
statement?
They're invisible obviously. Using CrLF keeps reverting to text a below.

UPDATE NewsArticles
SET NewsArticles.NewsData = Replace([NewsArticles]![NewsData],"CrLf","~");

thanks
 
J

John Vinson

I want to replace the line breaks and/or carriage returns in a memo field.
I know how to use the REPLACE function.
How do I represent line breaks or carriage returns in the following
statement?
They're invisible obviously. Using CrLF keeps reverting to text a below.

UPDATE NewsArticles
SET NewsArticles.NewsData = Replace([NewsArticles]![NewsData],"CrLf","~");

This will replace the four-character text string CRLF - which might
occur in some words in Czech or one of those other consonant-rich
languages!

The VBA constant vbNewLine or vbCrLf is not available in a Query;
you'll need the explicit ASCII codes instead:

Replace([NewsData], Chr(13) & Chr(10), "~")

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

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