Character Replacement

  • Thread starter orgelizer via AccessMonster.com
  • 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
 
A

Arvin Meyer [MVP]

Look up the Replace() function in the help files for VBA. The Replace
function will work in an Update query.
 
J

John W. Vinson

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]
 
J

John Nurick

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.
 
J

John Spencer

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
..
 
Top