Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1530
  • Last Modified:

Memo cell cuts off characters when data is copied from excel

I have created a table that gets it's data from a .xls file using a select all and cut from Excel 2010 and paste into my table in Access 2010. I have a cell that contains typed text that may be anywhere from 0 to a few thousand characters. In Access I set that field to memo which i thought would allow more than 255 characters.

My problem is that sometimes the memo cell will cut off the characters and not paste the entire contents. I can copy from Excel the single (for example) 500 character cell into Access and it will copy the full thing.

Any idea's how I can make the contents of the Excel file be mirrored in Access exactly?
0
Cole100
Asked:
Cole100
  • 12
  • 10
  • 5
10 Solutions
 
Rey Obrero (Capricorn1)Commented:
did you try importing the excel file to Access?

External Data > excel , then follow the wizard
0
 
Cole100IT Systems ManagerAuthor Commented:
That is how I set it up the first time. Each week I have 300 to 400 new records to add to the table so that is why I use the cut and paste
0
 
Rey Obrero (Capricorn1)Commented:
are these new records comes from a different excel file every week?


you can use vba command line to import the excel file

docmd.transferspreadsheet acimport,10, "TableName","c:\folder\myexcel.xlsx", true, "nameOfSheet!"
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
Jeffrey CoachmanMIS LiasonCommented:
As a test, if you simply copy a big cell (one that you know gets truncated) and paste it to notepad, does it truncate?
0
 
Cole100IT Systems ManagerAuthor Commented:
Using a vba command line is a bit outside my expertise. i am willing to give it a try just need more info on how to set it up.

i did try to use the import--->  append function in  Access and had the same results.

I tried a linked table and it cuts it off at 255 and will not let me change the field to memo.

I can paste the contents of the excel cell into notepad without isssue. I can even paste a cell that was truncated during the "mass" copy/paste into the cell in Access on an individual basis and it does not truncate it.

It appears to be random where it cuts off. See attached screenshot.
SnipImage.JPG
0
 
Rey Obrero (Capricorn1)Commented:
upload a copy of the db and the excel file.
0
 
Cole100IT Systems ManagerAuthor Commented:
0
 
Jeffrey CoachmanMIS LiasonCommented:
The data is all there, it is just the the column is not wide enough to display it all.
This is why you should be using a form to view this data, not a table/query (datasheet view)
Create a Form from this table, then the resulting textbox for the Comment memo field should give you scrollbars to view all of the data.
0
 
Jeffrey CoachmanMIS LiasonCommented:
In the form you can make the textbox bigger to get rid of the scroll bars.

In a report, you can set the "CanGrow" property of the textbox to: Yes
...and the textbox will get taller to display longer data.
0
 
Cole100IT Systems ManagerAuthor Commented:
I think there is data missing. For example, ID 463 or 555 in the return_comment field it does not have the whole comment as it does in the excel file. I have tried the forms and reports and the same limited data in the table appears in the form/report.

see attached screenshot of "cutoff" fields
snip2.JPG
0
 
Rey Obrero (Capricorn1)Commented:
see this db, the excel file were imported using the codes behind the button Import

what is the respondent_id of these records   that you posted ID 463 or 555
ces.accdb
0
 
Rey Obrero (Capricorn1)Commented:
click on the button Open query, it will open query2 showing the comments and the number of characters in the comments field. you will see that there are records with more than 255 characters
0
 
Cole100IT Systems ManagerAuthor Commented:
463 = 1773482429
555 = 1774832052

Issue appears in the return_comments not the comments. I used the len function (something new I learned, thanks) and that field max's out at 255

see attached...
snip3.JPG
0
 
Rey Obrero (Capricorn1)Commented:
try this one

open the same query


i'll explain later why this is happening...got to run outside for a while
ces.accdb
0
 
Cole100IT Systems ManagerAuthor Commented:
So I see that the character count has increased but it still does not actually display the correct amount text.

What am I missing?
0
 
Rey Obrero (Capricorn1)Commented:
<still does not actually display the correct amount text.>  which one ?
0
 
Cole100IT Systems ManagerAuthor Commented:
the query says that there are more characters then there actually is. see attached file for screenshot. you can clearly see that the words are being cut off
snip4.JPG
0
 
Jeffrey CoachmanMIS LiasonCommented:
capricorn1's suggestion of Appending the data via Excel import code should work for you.
It works just fine for me.

"Copy and Paste" is restricted by the clipboard.
It should not what is commonly used to import data like what you have.
0
 
Cole100IT Systems ManagerAuthor Commented:
If I  use the append "wizard" it still  cuts it off for me. are you using the vba command line? if so, how do I do that?
0
 
Rey Obrero (Capricorn1)Commented:
did you download the file i uploaded at http:#a37814005 ?
0
 
Cole100IT Systems ManagerAuthor Commented:
I did. Where do I set my source file path? I assume somewhere in here:

Private Sub cmdImportXL_Click()
Dim xlPath As String, xlFile As String
xlPath = CurrentProject.Path & "\"
xlFile = Dir(xlPath & "*.xls")
While xlFile <> ""

    DoCmd.TransferSpreadsheet acImport, 8, "myTable", xlPath & xlFile, True, "Sheet1!"


    xlFile = Dir
Wend
End Sub
0
 
Rey Obrero (Capricorn1)Commented:
change  this line

xlPath = CurrentProject.Path & "\"

with

xlPath="c:\folderName\"

c:\folderName\ is the folder where your excel file is
0
 
Cole100IT Systems ManagerAuthor Commented:
Argh! So the import tool is working great. Cool new feature I can use. Thanks

Still getting the same thing though. Check out Query3. Shows cutting off  at 255

I really appreciate all the time spent working me through this
ces.accdb
04022012.xls
0
 
Rey Obrero (Capricorn1)Commented:
did you change the Data Type of the field to Memo?
0
 
Cole100IT Systems ManagerAuthor Commented:
yes
0
 
Jeffrey CoachmanMIS LiasonCommented:
FWIW
This basic "TransferSpreadsheet" code that capricorn1 first posted works fine form me and does not truncate...

I'll leave this to him issue now...

JeffCoachman
0
 
Cole100IT Systems ManagerAuthor Commented:
I just do not get it. It is clearly truncating for me. See attached screenshot
snip5.JPG
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 12
  • 10
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now