How do I preserve (LF) on Access Reports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Myfield contains several Chr(10) embeded within the text. Access Reports do
not respect this (LF). If I output the table to Excel, it prints out
correctly.
How can I set up Access to respect (LF) in my report?
 
Myfield contains several Chr(10) embeded within the text. Access Reports do
not respect this (LF). If I output the table to Excel, it prints out
correctly.
How can I set up Access to respect (LF) in my report?

By using the proper Access characters for a new line:
chr(13) & chr(10)
in that order.

If you have a version of access that supports the Replace function you
can replace the chr(10) with chr(13) & chr(10):
=Replace([MyField],chr(10),chr(13) & chr(10))

On older versions of Access you can create a User Defined function,
using Left, Mid, Right, and Instr, to locate chr(10) and replace it
with chr(13) & chr(10).
 
Use the replace function to change Chr(10) to Chr(13) & Chr(10) in the
underlying query.

Replace([somefield, Chr(10), CHr(13) & CHr(10))
 
Back
Top