Best way to change a character in a string?

ian_w

Registered User.
Local time
Today, 14:45
Joined
Jun 13, 2006
Messages
64
Hi,

Im trying to create subfolders based on a value in a table, the values in the table currently have a "/" in them so this will need to be changed to a "-", whats the best way to change a value in Access 97 as the Replace() function is not available?
 
Here's a function I've used to remove characters:

Code:
Public Function StripChar(ByVal strRem as string) As String

dim wdArr as variant
dim i as integer
dim strRet as string

wdArr = split(strRem, "/")

strRet = ""

for i = lbound(wdArr) to ubound(wdArr)
   
   if i = lbound(wdArr) then
       strRet = wdArr(i)
   else
       strRet = strRet & "-" & wdArr(i)
   end if
next i

StripChar = strRet

end function

I've modified it so it will replace your char
 

Users who are viewing this thread

Back
Top Bottom