Find and Replace in a memo field

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
 
F

Fredg

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.
 

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