Quickest way to replace characters in a string

  • Thread starter Thread starter Ivor
  • Start date Start date
I

Ivor

Rather than running a find and replace macro or a routine,
Does anyone know a quicker way (running time) to replace
characters in a string i.e. replace a string of Ys and Ns
with 1s and spaces e.g. 'YYNNYNNY' goes to '11 1 1'.

TIA
Ivor
 
Ivor

One option would be a couple of Update Queries using the Replace()
function (assuming Access 2000 SR3 or later version). Do one query to
update YourText to...
Replace([YourText],"Y","1")
.... and another to update YourText to...
Replace([YourText],"N"," ")
Then, if you like, you can run these Update Queries in a macro using a
couple of OpenQuery actions. If you do this, you may want to put a
SetWarnings/No action before the first OpenQuery, to supress the display
of the action query confirmation messages.
 
Back
Top