Replacing characters

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

How can I replace characters like carriage return and double quotes from
strings?

Thanks

Regards
 
Hi

How can I replace characters like carriage return and double quotes from
strings?

The Replace() function can be used for this. Special characters
require special treatment - e.g. a carriage return is actually stored
in Access as two characters, carriage return (hex value 13) and line
feed (hex value 10). To replace them with a blank use

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

A doublequote is Chr(34):

Replace([fieldname], Chr(34), "'")

will replace all " with '.

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

Back
Top