Character Replacement

  • Thread starter Thread starter orgelizer via AccessMonster.com
  • Start date Start date
O

orgelizer via AccessMonster.com

I have a question--which is preeceded by a comment. The comment. My
question is an abbreviated example of what I'm wanting to do. I posted it in
another group and was chastised by someone who had no clue of what I was
trying to do. So, please realize the reason behind my question is more
complex than the example may appear.

Now the question. Is there any way, without manually typing every entry, of
replacing some characters (generally the same characters) in a string with
different characters? I've tried an update query, and that didn't seem to
work. Find and Replace also didn't work. I've got about 950 entries to do
this to (the characters found and replaced will not always be the same).

Any ideas?

Ken
 
Look up the Replace() function in the help files for VBA. The Replace
function will work in an Update query.
 
Now the question. Is there any way, without manually typing every entry, of
replacing some characters (generally the same characters) in a string with
different characters? I've tried an update query, and that didn't seem to
work. Find and Replace also didn't work. I've got about 950 entries to do
this to (the characters found and replaced will not always be the same).

Yes. An Update query using the VBA function Replace() will do this (in A2002
or later, I don't think it was available before that version. Run an Update
query updating the field MyField to

Replace([MyField], "oldstuff", "newandshiny")

to replace all instances of the text string oldstuff with the string
newandshiny.

John W. Vinson [MVP]
 
If you need something subtler than the Replace() function, the
rgxReplace() at j.nurick.dial.pipex.com/Code/index.htm may do what you
need.
 
FYI, Replace() was available starting in Access 2000.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 
The Replace function is only available in queries in 2000 if you have
applied the later service packs.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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

Back
Top