How can I substitute the Newline character for another in an Access database long text field?

Greg Dunn 0 Reputation points
2024-02-17T15:27:36.13+00:00

I'm trying to move multiline text data from Excel into Access. If the Excel data for one of the columns at issue includes line breaks, Access converts them to spaces upon import (whether done as an import, or via copy and paste). So I tried substituting a string token (e.g., "@@@") in the Excel data for the line breaks and importing that into Access. So far so good. But when I then substitute, in the Access data, Chr$(13) & Chr$(10) for the "@@@" token -- regardless of whether I do that using an update query or VBA code -- again the substituted Chr$(13) & Chr$(10) somehow turns into the space character and I have none of the desired line breaks. The Access field that is receiving the data is of type Long Text, and I have it set to accommodate Rich Text. I can manually enter line breaks in the data for that field just fine, but any way I try to do it programmatically fails as described above. What the heck?

Access
Access
A family of Microsoft relational database management systems designed for ease of use.
333 questions
0 comments No comments
{count} votes