Solved

Problem importing from Excel to memo field in Access

Posted on 2013-12-18
6
597 Views
Last Modified: 2013-12-19
I am trying to import an Excel spreadsheet into Access.  There are > 255 characters in a few of the Excel cells - and so I have set up the Access field as Memo.

However, when I use the following VB code to import the spreadsheet, the data is getting truncated.  What am I missing?

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "tbl_MASTER_temp", GetFile2, True

Thanks for your help,
je
0
Comment
Question by:aeolianje
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 350 total points
ID: 39728819
Try a couple of things:

- Check your table's design.  Do you have any formatting on your memo field in your table's design?  If so, remove it.

- Also try placing a row of 'junk' data at the top of your spreadsheet with more than 255 characters in the memo field (so that the first row in that column contains more than 255 characters).
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39728860
... and try importing the data into a table that does not exist in your database, so that the table structure is created by the import itself:

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "Newtbl_MASTER_temp", GetFile2, True
0
 
LVL 45

Expert Comment

by:aikimark
ID: 39729061
double check your import specification
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Closing Comment

by:aeolianje
ID: 39729158
Perfect!   The original import was setting the format of the fields to "@".  Once I removed that, it worked!

Thank you!
je
0
 
LVL 45

Expert Comment

by:aikimark
ID: 39729261
@aeolianje

Your closing comment suggests that the problem existed in the import specification.  However, the accepted solution comment does not seem to refer to the import specification.  Did you mean to accept that comment?
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39729450
aeolianje,

Glad to help.



akimark,

The TransferSpreadsheet method does not use import/export specifications:
http://msdn.microsoft.com/en-us/library/office/bb214134(v=office.12).aspx
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question