Solved

Memo cell cuts off characters when data is copied from excel

Posted on 2012-04-04
27
1,260 Views
Last Modified: 2012-04-12
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
Comment
Question by:Cole100
  • 12
  • 10
  • 5
27 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 37808811
did you try importing the excel file to Access?

External Data > excel , then follow the wizard
0
 

Author Comment

by:Cole100
ID: 37808815
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
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 500 total points
ID: 37808837
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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37811652
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
 

Author Comment

by:Cole100
ID: 37813255
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
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 500 total points
ID: 37813274
upload a copy of the db and the excel file.
0
 

Author Comment

by:Cole100
ID: 37813531
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37813823
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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37813842
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
 

Author Comment

by:Cole100
ID: 37813863
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
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 500 total points
ID: 37813875
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
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 500 total points
ID: 37813886
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
 

Author Comment

by:Cole100
ID: 37813947
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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 500 total points
ID: 37814005
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
 

Author Comment

by:Cole100
ID: 37816524
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
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 500 total points
ID: 37816648
<still does not actually display the correct amount text.>  which one ?
0
 

Author Comment

by:Cole100
ID: 37817089
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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37823575
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
 

Author Comment

by:Cole100
ID: 37824086
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
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 500 total points
ID: 37824173
did you download the file i uploaded at http:#a37814005 ?
0
 

Author Comment

by:Cole100
ID: 37824209
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
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 500 total points
ID: 37824250
change  this line

xlPath = CurrentProject.Path & "\"

with

xlPath="c:\folderName\"

c:\folderName\ is the folder where your excel file is
0
 

Author Comment

by:Cole100
ID: 37824423
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
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 500 total points
ID: 37824550
did you change the Data Type of the field to Memo?
0
 

Author Comment

by:Cole100
ID: 37824561
yes
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37824581
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
 

Author Comment

by:Cole100
ID: 37824633
I just do not get it. It is clearly truncating for me. See attached screenshot
snip5.JPG
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

910 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now