Replacing characters

J

John

Hi

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

Thanks

Regards
 
J

John Vinson

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
 
Top