0

I am creating an MS Access front end for data from somewhere else.

In this case, it's a linked SQL Server table.
The data is actually imported from a shared-hosting LAMP web server.
It's the results of an online quiz from a Wordpress page, from a plugin (wp-pro-quiz).

I'm going crazy because I simply want to view the data in this one column as plain text, but with line breaks.
But Access is ignoring the line breaks in the data.

I'm in a Form because I'm doing other data entry tied to this info. I've tried it with a Textbox or a Label -- both are ok because I don't want to edit this column itself.
I keep checking with different tools that there are line break characters.

I also have tried editing the data by using a Textbox and pressing Ctrl-Enter.
This gives me a line break on the screen.
I swear when I check the data in a text editor the characters are the same as from my table. Aaargh!

What does Access want to be happy and show my line breaks from the table?

0

Well, what Access wants for line breaks it can respect is

  • Windows line breaks
  • == CR-LF
  • or - since you like Access - Chr(13)&Chr(10) , or vbCrLf

If you're data is from a unix box, it's very reasonable it is just using the "linefeed" = LF = Chr(10).

You say you're verifying the source data in a text editor that it has crlf. I'm assuming you're on Windows if you're using Access.
Because crlf is the standard in Windows, we should ask:

Is there any chance you're doing that verification in a way that's causing all line breaks to appear as crlf in that text editor - hiding your source data problem?
If you copy-and-paste you have even more risk of this in some text editors.

'
'
Having all LF line breaks is a really realistic explanation here.
Since you're comfortable looking at special characters, try checking the line endings in your source data with a tool that never alters the data automatically such as xvi32:
http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm
'

  • If you do find it is only LF for all your line breaks,
  • do a string replace for Chr(10) --> Chr(13)&Chr(10)
  • wherever makes the most sense for your application.

and Access will show line breaks.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.