Undefined Function Replace and InStrRev

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

There are two functions: Replace and InStrRev which I am using in the query.
The query works on my home computer which has Access 2003 but not on my work
computer which has Access 2000 Version 9.0. I checked the help screen and
they are defined as a valid functions for Access 2000, but I am getting the
message: Invalid Function Replace and Invalid Function InStrRev when I run
the query. Is there perhaps some library module missing ?
 
There are two functions: Replace and InStrRev which I am using in the query.
The query works on my home computer which has Access 2003 but not on my work
computer which has Access 2000 Version 9.0. I checked the help screen and
they are defined as a valid functions for Access 2000, but I am getting the
message: Invalid Function Replace and Invalid Function InStrRev when I run
the query. Is there perhaps some library module missing ?

Assuming your library references are OK, Replace and InStrRev were
introduced in Access 2000. However in some earlier versions of 2000
you cannot use them directly in a query.
You can create a module and call that from the query.

For example, to replace all hyphens in a text field with a space:
In a module ...
Function DoAReplace(StringIn as String) as string
Replace(StringIn,"-"," ")
End Function

Then call it from the query:
NewColumn:DoAReplace([FieldName])
 
Thank you.

fredg said:
There are two functions: Replace and InStrRev which I am using in the query.
The query works on my home computer which has Access 2003 but not on my work
computer which has Access 2000 Version 9.0. I checked the help screen and
they are defined as a valid functions for Access 2000, but I am getting the
message: Invalid Function Replace and Invalid Function InStrRev when I run
the query. Is there perhaps some library module missing ?

Assuming your library references are OK, Replace and InStrRev were
introduced in Access 2000. However in some earlier versions of 2000
you cannot use them directly in a query.
You can create a module and call that from the query.

For example, to replace all hyphens in a text field with a space:
In a module ...
Function DoAReplace(StringIn as String) as string
Replace(StringIn,"-"," ")
End Function

Then call it from the query:
NewColumn:DoAReplace([FieldName])
 
Back
Top