Find and Replace in a memo field

  • Thread starter Thread starter George Slamowitz
  • Start date Start date
G

George Slamowitz

Hello everyone

I am looking for a code snipplet that will dynamically do
a find and replace in a database memo field when it is
being printed to a report.

Any help would be appreciated.

Thanks in advance

George
 
If you have Access 2000 or later:
Include the Memo field in the report detail section, but make it not
visible.
Add an unbound text control. Set it's CanGrow property to Yes.
Code the Detail Format event:

If IsNull([MemoField]) Then
Else
[UnboundControlName] = Replace([MemoField], "X", "Z")
End If

where "X" is to be replaced by "Z".

If you have Access 97 or earlier, the Replace Function is not available,
but you could loop through the MemoField and replace all X's with Z's using
the
InStr() and Mid() functions. Then assign that new text to the unbound
control.

If you have Access 97 and need help with that, post back.
 
Back
Top