Replace not working in report on some systems

L

LisaConsult

I have an MDE application which tested fine on a test machine and is
installed in several locations without any problems. We recently installed
it at a client site and they are receiving a "Enter Parameter value Replace"
any time they run a report which uses "=Replace(....)" in the Text field. In
all cases we install Access Runtime 2000 SR-3. Some OS's are XP, others are
2000 and they work fine. This problem is occurring on a 2000 machine. What
are they missing or what would cause this problem? Thanks
 
A

Allen Browne

There is a known issue with these functions on Access 2000:
FormatCurrency(),
FormatDateTime(),
FormatNumber(),
FormatPercent(),
InStrRev(),
MonthName(),
Replace(),
Round(),
StrReverse(),
WeekdayName()
Microsoft has an k.b. article covering this:
http://support.microsoft.com/?id=225956

You would expect that a fully patched A2000 machine (both SR3 for Office
2000 and SP8 for JET 4) would not have the problem. I got caught also: my
dev machines do not have the problem, but a fully patched client does!

I was not able to identify the difference. (Perhaps it's because I have
later versions of Access on my machines as well?)

The workaround is to create a a wrapper function in VBA, and call that
instead:

Function ReplaceX(varIn As Variant, strFind As String, strReplace As String,
_
Optional lngStart As Long = 1, Optional lngCount As Long = -1) As Variant
'Purpose: Wrapper for Replace() which has problems in Access 2000.
' Also handles nulls (in and out.)

If Len(varIn) > 0& Then
ReplaceX = Replace(varIn, strFind, strReplace, lngStart, lngCount)
Else
ReplaceX = Null
End If
End Function
 
L

LisaConsult

Thanks for the info. Based on the content of the article, I don't understand
why it does work on some machines which only have ART, but making the code
change as suggested does work. I appreciate your assistance.
 

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