Avatar of Liberty4all
Liberty4all
Flag for United States of America asked on

Truncation of memo field in Access 2010 query

When I run a select query in Access 2010 the output for a memo field truncates at 255 characters.  I'm guessing this is normal based on various sources.  My query does not contain any aggregate functions (no group by and no expressions).  The property settings for the query are all blank so nothing appears to be suspect there.  The problem is the output results need to be exported to Excel, and since the memo column is not fully populated in the query, the result in Excel is also incomplete.

If I change my query to create a table and export or copy that to Excel, the problem does not exist.  However, for certain projects this means having to create multiple temporary tables and then deleting them.  If someone can suggest a way to modifying the query to have the full contents of the memo field appear, if possible, that would save some time and be much appreciated.
Microsoft Access

Avatar of undefined
Last Comment
Liberty4all

8/22/2022 - Mon
Kelvin Sparks

The method that you describe of using temporary tables is the accepted solution. I have not seen any other solution to this known problem.


Kelvin
Rey Obrero (Capricorn1)

you can use VBA and recordset to achieve this
Liberty4all

ASKER
If the code is not too lengthy I might try it.  My queries are simple and don't want to make them more complex than necessary.  If you can please post the code I will look at it and determine if the time it takes to make it work is less than what I'm currently doing.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Rey Obrero (Capricorn1)

when you export to excel, are you using an excel template?, existing excel file?
Liberty4all

ASKER
I don't use an Excel template or an existing file.  I create a new Excel file and then add individual worksheets for multiple exports into it (populated by pasting).
ASKER CERTIFIED SOLUTION
Rey Obrero (Capricorn1)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Kelvin Sparks

You also need to treat this approach with caution. I have found through experience at times, Excel (not Access) will truncate data in some cells to 1024 characters. - seems to happen when a larger number of rows are being returned, or where a lot of columns are involved.


Kelvin
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Liberty4all

ASKER
Rey,

The code runs and exports the Access table to Excel as expected.  The only problem is the column for the memo field essentially overwrites two columns to the right of it with data.  The column headings for the two fields to the right of the memo field appear but only the contents of the memo field appear in them in certain cases.  Those two columns contain numeric data.  Some of them are blank and, if so, the contents of the memo field populates them depending on the amount of text.  This does not happen when the length of the text string in the memo column is shorter.

The result is confusing for users and thus will not work.  I cannot post the actual results due to confidentiality but will attempt to describe how it appears in the attached file.  The third row in the attached file is the desired result but only appears when the length of the memo text string is relatively short.

If I expand the Memo column the contents still appear in the next two columns.  Expanding the two numeric columns doesn't solve the problem.  Can you suggest a way to fix this?
Memo-Column-Overflow.docx
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Liberty4all

ASKER
Perfect!  Only change needed was to the cell reference ("b2:b100") to the one containing the memo field.

Thank you very much!
Rey Obrero (Capricorn1)

pls. don't forget to close the thread
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Liberty4all

ASKER
Please note the comments from Kelvin Sparks regarding Excel (not Access) will truncate data in some cells to 1024 characters.  I have not confirmed this can occur using the code above but mention it so others are aware of it as a possibility.
Liberty4all

ASKER
Rey,

I had difficulty closing the thread until now.  I switched from using Internet Explorer 8 to Chrome and that allowed my selection of solutions, points, and grade to finally be accepted.