How to Search and replace a string with formatted text?

S

SF

Hi,

I have a project workplan table consist of 4 fields (PWID (PK), Pr_ObjectID
(FK), Activity (memo), Evidence (Memo)). The last two fields are set to use
access 2007 RTF and they store work in Khmer (Cambodian Font). What I want
to do is to do automated search thru each field and find a word TT and
replace with CMC in english font.

I cannot find a way to do that automatically, could someone help? What I am
doing now is to press Ctl + F, find the spedific string, close the find
dialog and paste the desire string (CMC). This process is very slow.

SF
 
S

Software-Matters

Hi,
You are doing the right thing but missing a step as follows:

Use Ctrl-F to open the Find and Replace window.
Click on the Replace tab and enter the text to find and text to replace as
desired. Now click Replace All.

Regards
JD
--
<a
href="http://www.software-matters.co.uk/bespoke-database-design.html">Bespoke
Access Database Development</a>
<p>Software Matters</br>
Straightforward solutions that work</p>
 
P

Paul Shapiro

I don't understand what you mean by "TT" and "CMC", but generally you can
replace strings in a single operation using Ctrl-H (replace) instead of
Ctrl-F (Find). That will give you a dialog with the option of replacing all
occurences in the current field in the current record.

If you want to do this in all rows of data, use an Update Query instead,
something like:

Update WorkPlan
Set
Activity = Replace([Activity], "string-to-find",
"string-to-use-as-replacement")
,Evidence = Replace([Evidence ], "string-to-find",
"string-to-use-as-replacement")

If this is a large table and less than half the rows contain your strings,
you could optimize a bit by using two queries:

Update WorkPlan
Set
Activity = Replace([Activity], "string-to-find",
"string-to-use-as-replacement")
Where Instr([Activity], "string-to-find") > 0

and equivalent for the other field.
 

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