Replace Function Help

T

Terry

I am using Access 2003, and am using the "replace" function to strip some
unwanted characters from a dataset. My problem is that I need to import that
query into a larger database that is on computers using Access 2000, which
does not have the replace function.

Is there a simular function in Access 2000?, or
Is there a way to import the replace function to an existion Access 2000
database?

Terry Schawe
 
W

Wayne Morgan

Access 2000 does have the Replace function; however, it won't work in a
query. What you need to do is create your own function and call it. You can
use Replace in that function.

Example:

Public Function MyReplace(strSearchString As String, strFindWhat As String,
strReplaceWith As String) As String
MyReplace = Replace(strSearchString, strFindWhat, strReplaceWith)
End Function
 
W

Wayne Morgan

Terry,

Are you still having a problem? If so, can you post the SQL of the query?
 
B

Brendan Reynolds

You could still be right about the cause of Terry's problem, Wayne. The
Replace() function definitely did not work in queries when Access 2000 was
originally released. I could be wrong about this, but I suspect that whether
it works or not in Access 2000 now probably depends on the versions of the
Jet and/or VBA DLLs present.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Top