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

How to convert one string to another

P: n/a
On my table I have a memo type field "notes".
I want to convert the text. Whenever the word "John" mentioned, i want
it to be converted to "Bill".
For example.
If in one record "notes" says: "John went to school, and then John came
back" , it will be converted to "Bill went to school, and then Bill
came back.

Any idea how to do this?

Thanks,

galsaba

Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a

"galsaba" <ga*****@aol.com> ha scritto nel messaggio
news:11**********************@g14g2000cwa.googlegr oups.com...
On my table I have a memo type field "notes".
I want to convert the text. Whenever the word "John" mentioned, i want
it to be converted to "Bill".
For example.
If in one record "notes" says: "John went to school, and then John came
back" , it will be converted to "Bill went to school, and then Bill
came back.

Any idea how to do this?

Thanks,

galsaba


Hello,
use the function Replace ( documentation by help...) how in this example

Replace (notes, "John","Bill")

ok?

Good Night

Nov 13 '05 #2

P: n/a
Great!
Thanks!!

Nov 13 '05 #3

P: n/a
Great!
Thanks!!

Nov 13 '05 #4

P: n/a
I just found out this this function exists in access xp but not in
access 2000. Any solution?

Nov 13 '05 #5

P: n/a
It exisits in Access2000 but can't be used in queries.

Wrapping it in your own function should work e.g.

Public Function MyReplace( _
Expression As String, _
Find As String, _
Replace As String, _
Optional Start As Long = 1, _
Optional Count As Long = -1, _
Optional Compare As VbCompareMethod = vbBinaryCompare) As String

MyReplace = VBA.Replace(Expression, Find, Replace, Start, Count, Compare)

End Function

Which in your example becomes
MyReplace([notes], "John", "Bill")

"galsaba" <ga*****@aol.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
I just found out this this function exists in access xp but not in
access 2000. Any solution?

Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.