Line feeds not working with a report

M

mwilliams4

I have a field in my table which is a memo field.

The data in that field has embedded Linefeeds.

I created a report (wide enough for my data) and the linefeed
characters show (empty squares) but they are3 not recognized either on
the scree or printed.

If I paste that very same data into ms-word, it shows on screen and
prints out perfectly.

How do I correct this?

Thanks!
 
F

fredg

I have a field in my table which is a memo field.

The data in that field has embedded Linefeeds.

I created a report (wide enough for my data) and the linefeed
characters show (empty squares) but they are3 not recognized either on
the scree or printed.

If I paste that very same data into ms-word, it shows on screen and
prints out perfectly.

How do I correct this?

Thanks!

The new line characters in Access are:
Chr(13) & Chr(10)
in that order.
I would suspect that the data in the Memo field came from Word or
Excel which use just the Chr(10) line feed character.

You could run an Update query on your memo field to replace chr(10)
with chr(13) & chr(10)

Back up your data first.

Update YourTable set YourTable.MemoField =
Replace([MemoField],chr(10),chr(13) & chr(10))

This will only affect current data.
 
F

fredg

so is that a CR LF or LF CR ?

Chr(13) & Chr(10)
in that order.

chr(13) is Carriage Return
chr(10) is Line Feed

If you are doing this in VBA you could use the VBA constants of
either
vbCrLf
or
vbNewLine

In VBA:
MyControl = Replace([Memo],vbLf,vbCrLf)

where vbLf is the VBA constant for chr(10).

Directly in an Access control source (or in a query) you must use
Chr(13) & Chr(10)
=Replace([Memo],chr(10),chr(13) & chr(10))
 

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