472,985 Members | 2,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,985 software developers and data experts.

"Replace" supported in 97?

Hi,

Can anyone tell me if "replace" is supported by Access 97? I use the Dutch
version and get the errormessage "sub or function not supported". Or is the
Professional Edition needed?

Thanks.
Nov 13 '05 #1
3 10453
asd987 <as****@home.nl> wrote:
Can anyone tell me if "replace" is supported by Access 97? I use the
Dutch version and get the errormessage "sub or function not
supported". Or is the Professional Edition needed?


"Replace" isn't aviable in Access 97, you need for it Access 2000

Helge

--
Verheiratete Männer leben länger als unverheiratete,
aber sie sind viel eher bereit zu sterben.
Nov 13 '05 #2
There is code at "The Access Web" that you can use :

http://www.mvps.org/access/strings/str0004.htm
hth,
--

Cheryl Fischer, MVP Microsoft Access

"asd987" <as****@home.nl> wrote in message
news:c8*********@news3.tilbu1.nb.home.nl...
Hi,

Can anyone tell me if "replace" is supported by Access 97? I use the Dutch
version and get the errormessage "sub or function not supported". Or is the Professional Edition needed?

Thanks.

Nov 13 '05 #3
Replied yesterday but it's not showing up so sorry if this appears as a
re-post
------------------------

Hmm, it's not case sensitive though.

The following seems to follow the same rules as the A2k Replace function as
documented (except the ability to pass vbUseCompareOption as the Compare
parameter)

'*********** Code Start ***********
Public Function Replace( _
Expression As String, _
Find As String, _
ReplaceWith As String, _
Optional Start As Integer = 1, _
Optional Count As Integer = -1, _
Optional Compare As Integer = vbBinaryCompare _
)

'*******************************************
'Name: Replace (Function)
'Purpose: Access97 version of the A2k Replace function
'Author: Terry Kreft
'Date: June 01, 2000, 02:44:34
'Called by: Any
'Calls: None
'Inputs: Expression - String to Search
' Find - Sub-String to be replaced
' ReplaceWith - Sub-String to insert
' Start - Optional start of string to return and replace
' Count - Optional number of replacements to carry out
' Compare - Optional compare method to use _
(valid values are 0, 1, 2)
'Output: 1) If Expression is zero-length then a zero-length string ("")
' 2) If Expression is Null then an error
' 2) If Find is zero-length then a copy of Expression.
' 3) If ReplaceWith is zero-length then a copy of _
Expression with all occurences of find removed.
' 4) If Start > Len(Expression) then a zero-length string.
' 5) If Count is 0 then a copy of Expression.
'*******************************************

Dim intInstr As Integer
Dim intCount As Integer
Dim intFindLen As Integer
Dim intRepLen As Integer
Dim strRet As String
Dim strTemp As String
On Error GoTo Replace_err

intFindLen = Len(Find)
intRepLen = Len(ReplaceWith)

If Compare < vbBinaryCompare Or Compare > vbDatabaseCompare Then
Err.Raise 1 + vbObjectError, Description:="Bad compare method"
ElseIf Len(Expression) = 0 Or Start > Len(Expression) Then
strRet = ""
ElseIf Count = 0 Or intFindLen = 0 Then
strRet = Expression
Else
strTemp = Mid(Expression, Start)
intCount = Count
intInstr = InStr(1, strTemp, Find, Compare)
Do While intInstr > 0
strRet = strRet & Left(strTemp, intInstr - 1) & ReplaceWith
strTemp = Mid(strTemp, intInstr + Len(Find))
intInstr = InStr(1, strTemp, Find, Compare)
intCount = intCount - 1
If intCount = 0 Then Exit Do
Loop
End If
strRet = strRet & strTemp
Replace_end:
Replace = strRet
Exit Function
Replace_err:
strRet = ""
With Err
.Raise .Number, .Source, .Description, .HelpFile, .HelpContext
End With
End Function
'*********** Code End ***********

--
Terry Kreft
MVP Microsoft Access
--
Terry Kreft
MVP Microsoft Access
"Cheryl Fischer" <ch***********@NOSPAMmsn.com> wrote in message
news:eU*************@TK2MSFTNGP09.phx.gbl...
There is code at "The Access Web" that you can use :

http://www.mvps.org/access/strings/str0004.htm
hth,
--

Cheryl Fischer, MVP Microsoft Access

"asd987" <as****@home.nl> wrote in message
news:c8*********@news3.tilbu1.nb.home.nl...
Hi,

Can anyone tell me if "replace" is supported by Access 97? I use the Dutch version and get the errormessage "sub or function not supported". Or is

the
Professional Edition needed?

Thanks.


Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rick Brandt | last post by:
Here is a simplified example of what I am passing to a Java SAX parser within a servlet via an HTTPRequest... <?xml version="1.0"?> <Record> <ID>1092853685</ID> <Notes><!]></Notes> </Record>...
6
by: Dean Slindee | last post by:
Private NameLastFirst as object = "Public, John Q." NameLastFirst = Replace(LastName, "'", "''") If NameLastFirst contains "Public, John Q." before the above Replace, it will contain "Public"...
3
by: Louis | last post by:
I have a problem using the REPLACE method. Here is a short description: In a.html: I used the following to call the chgtitle function: <a href=" "...
1
by: namemattersnot | last post by:
Here's my code: ### myvar = "test1_1;test2_1;test3_1"; myvar = myvar.replace(/_1/g, "_2")'; ### it works just fine. if I introduce "cat = 1", how do I change my replace function so that...
1
by: Ned | last post by:
I record where equipment is stored by using a text field. There is also a Building/Room table. A certain building has changed prefixes. Is there any way to accomplish a partial "replace" so that...
2
by: MCSmarties | last post by:
Hello all, first post here. I am using an old audio effects plugin (a .DLL) . It's "portable" (meaning that it doesn't need to be installed to run) but nevertheless it registers its equalization...
2
by: John Nagle | last post by:
I'm trying to clean up a bad ASCII string, one read from a web page that is supposedly in the ASCII character set but has some characters above 127. And I get this: File...
8
by: Ulysse | last post by:
Hello, I need to clean the string like this : string = """ bonne mentalit&eacute; mec!:) \n <br>bon pour info moi je suis un serial posteur arceleur dictateur ^^* \n ...
5
by: Curious | last post by:
I have: if (temp.Contains("Account") == true) { temp.Replace("Account", "Client"); } The "Account" is not replaced by "Client" after this operation. I used
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.