Undefined Function Replace and InStrRev

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 ?
 
F

fredg

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])
 
G

Guest

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])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top