replacing text during output

A

asd987

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.
 
G

Graham Mandeno

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.
 

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