Replace " ' " with blank space

mfaqueiroz

Registered User.
Local time
Today, 10:40
Joined
Sep 30, 2015
Messages
125
Hey all,
I want to replace the " ' " to blank spaces.
(e.g it's ---> it s"

I tried to write the follow code, but always give me the run-time error 3075, sytanx error in tring in query expression...

PHP:
 DoCmd.RunSQL "Update [TableName] set Field1= replace(field1, ''' , '') "


Do you know what i'm doing wrong?

thanks :)
 
try.. replace(Field1,chr(39),' ')
or
replace(field1,chr(39),chr(32))
 
if this it to replace ' in names like O'Reilly then I don't recommend you do that until you read the rest of this post.

If it is, the reason is probably because you are getting errors because of the '. If this is the case then leave the ' in your field values and cater for it in your code e.g. in a query criteria

... name like "*" & replace(forms!from!searchtxt,"'","''") & "*"

you replace the single quote with two single quotes
 

Users who are viewing this thread

Back
Top Bottom