Question Problem with line breaks when importing from Excel (1 Viewer)

Trap26

New member
Local time
Today, 08:06
Joined
Jul 4, 2008
Messages
2
I have a problem when I try to import an excel 2003 spreadsheet in Access. Some cells in the spreadsheet contain text with forced line breaks (example: http://www.wanan.dk/excel.jpg) but when I import the data in Access the line breaks are substituted by small square boxes like here: http://www.wanan.dk/access.jpg . (Happens both in table view and in forms). Does anyone know what is going on and how I can prevent this from happening without having to edit all entries manually?

Best regards!
Mads Jensen
 
Last edited:

neileg

AWF VIP
Local time
Today, 07:06
Joined
Dec 4, 2002
Messages
5,975
What do you want to happen? Do you want to preserve the line breaks or delete them?
 

Trap26

New member
Local time
Today, 08:06
Joined
Jul 4, 2008
Messages
2
I would like to preserve the line breaks, so the text looks like it does in Excel.
 

neileg

AWF VIP
Local time
Today, 07:06
Joined
Dec 4, 2002
Messages
5,975
I can't think of a way to sort this. The problem is that Excel cheats when you use line breaks and what is stored is not what you see on screen. The cell contents are wrapped in quote marks and I don't know what the character is that indicates the line break. It may or may not be a CrLf. Sorry.
 

namliam

The Mailman - AWF VIP
Local time
Today, 08:06
Joined
Aug 11, 2003
Messages
11,695
I think you have to play around with Replace and then try and replace the various CrLf and LF and Cr and different stuff with a actual one.

See if trail and error gets you any place.

You can also try and use Instr for testing to see if it will find the LF to start with, to see if the replace will work.
 

mikeo1313

Registered User.
Local time
Today, 02:06
Joined
May 27, 2010
Messages
50
I know this is an old post but how did the issue end up getting resolved as I have a similar issue. Thanks
 

Users who are viewing this thread

Top Bottom