Replace function in Access 2000

cliff7376

Registered User.
Local time
Today, 16:04
Joined
Oct 10, 2001
Messages
107
I am trying to use the replace function in one of my queries and i get the error "Undefined function replace in expression". I was under the impression that access 2K had this capability. The replace function works in the form code. Is there some reference file I am missing or something? Any help would be appreciated.
Thanks
Sean
 
I found the problem. I guess the replace function will not work in a query but i found a way it can. You make a function in a module and use that. I did the following in a module and it worked great using the replaceq() function I created

Function ReplaceQ (pString1 As String, pFind As String, pReplacement As String) As String

ReplaceQ = Replace(pString1, pFind, pReplacement)

End Function
 
Well that's strange. The Replace() function worked for me in Access 2000 exactly the way I expected it to. I created a calculated column like this:
Changed:Replace([MyField],"Smith","Jones")

It replaced all instances of "Smith" to "Jones" in MyField.
 
dcx693 said:
Well that's strange. The Replace() function worked for me in Access 2000 exactly the way I expected it to. I created a calculated column like this:
Changed:Replace([MyField],"Smith","Jones")

It replaced all instances of "Smith" to "Jones" in MyField.

in the query module? I must be missing something in my instalation then.
 

Users who are viewing this thread

Back
Top Bottom