Article ID: 210372 - View products that this article applies to.
This article was previously published under Q210372
Moderate: Requires basic macro, coding, and interoperability skills.
This article applies only to a Microsoft Access database (.mdb).
When you import a Microsoft Excel spreadsheet into Microsoft Access, the carriage return character (<CR>) appears as a small square.
For example, if you import a Microsoft Excel spreadsheet mailing list with complete addresses stored in single cells formatted with carriage returns, the addresses appear in Microsoft Access as single lines with squares between the address items.
This behavior occurs because the carriage return character (<CR>) used in Excel (ALT+ENTER) differs from that used in Access (CTRL+ENTER). As a result, the <CR> characters in Excel spreadsheets are not parsed into <CR> characters in Access, but into graphics characters.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. To resolve this behavior, you can convert the carriage return characters used in Excel to those used in Access. To create a user-defined function to do that, follow these steps:
NOTE: You may need to increase the row height in Datasheet view to observe the multiple lines.
Steps to Reproduce Behavior
For more information about importing spreadsheet data, click Microsoft Access Help on the Help menu, type import or link data from a spreadsheet in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
For more information about InStr() function, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type InStr in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
The example companies, organizations, products, people and events depicted herein are fictitious. No association with any real company, organization, product, person or event is intended or should be inferred.