Cannot Get Replace Function To Work

NJudson

Who farted?
Local time
Today, 15:53
Joined
Feb 14, 2002
Messages
297
This is driving me nuts!!!! I'm using Access 2k and I can't get replace function to work. I tried using:

Replace(sExpression, sFind, sReplace) but whenever I use the parenthesis the text turns red. The only syntax that Access accepts is:

Replace sExpression, sFind, sReplace

The code runs but the replace function isn't replacing anything. Is there something in the reference library that I need or some sort of add-in. I've even found a vba version of replace function on net and when I run it I get the same problems. I really appreciate on ideas on this. If I don't get this fixed I'm probably going to leave work with a terrible case of road rage and run a bus full of innocent nuns off the road....and maybe I'll run over a few hapless poodles that might get in my way too! Thanks.
 
You need to tell Access where to put the returned string e.g.

sNewExpression = Replace(sExpression, sFind, sReplace)

or

sExpression = Replace(sExpression, sFind, sReplace)
 
Last edited:
Thanks a lot Jon. It's the stupid obvious solutions that really kill me.....aaarrgghhhh!!! Much appreciated! :)
 

Users who are viewing this thread

Back
Top Bottom