Replace character with a paragraph mark

  • Thread starter Thread starter Robert Neville
  • Start date Start date
R

Robert Neville

I need to clean up and organize a memo field in order to make more
legible. Presently, the memo field has a dash and a space where I
would like to insert a paragraph mark. The process should search for a
dash and a space; and replace with a carriage return and line feed
characters plus the dash and space should remain.

Access native find and replace does not document if you insert a
paragraph marks. Word's find and replace engine has this abilities
through a wildcard command, ^p. In addition, I have coded a regular
expression routine tied to a vbscript reference. The routine iterate
through an Access table with both patterns and replacement, yet the
routine has trouble with vbCrLF in the replacement field. It treats as
literal text. Otherwise the routine works great. I have not explored
a query a great deal. Please let me know if you could lead in the
right direction.
 
If you have Access 2000 or newer, there is a Replace() function. Have you
tried that? You could use the function in the following manner:

Replace([MyMemoField],"- ", Chr(13) & Chr(10) & "- ")

It will return text looking like:

Now is the time
- for all good men
- to come to the aid
- of their country

hth,
 
Back
Top