By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,392 Members | 1,556 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,392 IT Pros & Developers. It's quick & easy.

replacing text during output

P: n/a
Hi,

Ihave to print a field (type memo) to a file. I know how to do that ;-), but
there's one complication: all single quotes (') in the record must be
replaced by <backslash> + <single quote> (\') before (or during) printing to
the file. How do I do this?

Thanks.
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You can use the Replace function to change all the quotes as required:
Replace( [FieldName], "'", "\'" )

You didn't say *how* you were writing to the file, but if it's using VBA
file Print# then you can use store the Replace result in a temporary string
variable and write that to the file. If you're using TransferText, then use
Replace in your source query.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

"asd987" <as****@home.nl> wrote in message
news:c8**********@news5.tilbu1.nb.home.nl...
Hi,

Ihave to print a field (type memo) to a file. I know how to do that ;-), but there's one complication: all single quotes (') in the record must be
replaced by <backslash> + <single quote> (\') before (or during) printing to the file. How do I do this?

Thanks.

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.