By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,501 Members | 2,790 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,501 IT Pros & Developers. It's quick & easy.

Replace Function in Access 2000 Report Text Box Control Source Expression Quits Working in Windows 2000

P: n/a
I've had an Access 2000 app running successfully for many months on
both Windows XP and Windows 2000. Recently when my Windows 2000 users
call a particular report, they get first a dialog requesting a
"Replace" parameter. If the user clicks OK, the report opens, but only
displays #Error. When the user tries to close the report, he is next
presented with the choice of halting the code in break mode or not.
Regardless of his choice, the app locks up and the user has to close
the app with Task Manager.

There is a text box on this report with the following expression in
the control source: =Replace([ClassName],"|"," - ") & " Sign-In Sheet"

The Replace Function works fine in VB, so I built the following
workaround:

Public Function FixIt(str As String, sReplace As String, sWith _
As String)
If Not InStr(str, sReplace) = 0 Then
FixIt = Replace(str, sReplace, sWith)
Else
FixIt = str
End If
End Function

I replaced the control source expression above with:
=Fixit([ClassName],"|"," - ") & " Sign-In Sheet"

Voila! It works. But why oh why did the Replace Function spontaneously
combust? Remember, it worked before and it still works on XP machines.
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
It sounds like these machines have JET service pack 7 loaded which was quite
buggy. Upgrade to service pack 8.

Note that Service Pack 7 is a critical patch on Windows Update because it is a
security fix. Service Pack 8 is not a critical update because it is not a
security patch, but a bug fix to a security patch.

On 3 Dec 2003 12:18:20 -0800, sd*****@charter.net (Sharon) wrote:
I've had an Access 2000 app running successfully for many months on
both Windows XP and Windows 2000. Recently when my Windows 2000 users
call a particular report, they get first a dialog requesting a
"Replace" parameter. If the user clicks OK, the report opens, but only
displays #Error. When the user tries to close the report, he is next
presented with the choice of halting the code in break mode or not.
Regardless of his choice, the app locks up and the user has to close
the app with Task Manager.

There is a text box on this report with the following expression in
the control source: =Replace([ClassName],"|"," - ") & " Sign-In Sheet"

The Replace Function works fine in VB, so I built the following
workaround:

Public Function FixIt(str As String, sReplace As String, sWith _
As String)
If Not InStr(str, sReplace) = 0 Then
FixIt = Replace(str, sReplace, sWith)
Else
FixIt = str
End If
End Function

I replaced the control source expression above with:
=Fixit([ClassName],"|"," - ") & " Sign-In Sheet"

Voila! It works. But why oh why did the Replace Function spontaneously
combust? Remember, it worked before and it still works on XP machines.


Nov 12 '05 #2

P: n/a
Wow, Steve, that was quick! Thanks for the noble effort, but it didn't
work. I even tried refreshing all my references after I installed Jet
Service Pack 8.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.