replacing text during output

  • Thread starter Thread starter asd987
  • Start date Start date
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.
 
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.
 
Back
Top