Replace (in Access 97)

G

Guest

Hello,

I am trying to programatically replace ":" with "." for all records in all
fields in a table. Everyone mentions the replace funtion but this is not
available in Access '97.

Can anyone suggest another way to solve this problem?

I don't want the user to undertake the replace themselves as they will not
see the data.

Thanks,

Martin
 
G

Guest

Hi Martin

Try:

Spin around each record in each field and use coding:

Dim strOld, strNew

strOld = string contents you want to convert
strNew = "" ' this is a two " 's
For n = 1 to Len(strOld)
If Mid(strOld, n, 1) = ":" then
strNew = strNew & "."
Else
strNew = strNew & Mid(strOld, n, 1)
End If
Next n

strNew now contains the new string with the :'s replaced by .'s

Let me know if you need to know how to spin around the fields/records.

Cheers.

BW
 

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