| ACC2000: Memo Field Truncated When Report Is Output to ExcelID: Q208801 
 | 
When you output a report to Microsoft Excel, any Memo field is truncated to 255 characters. You may also see this behavior when you click the Analyze It With MS Excel command while you are previewing a report.
In Excel, the maximum length of text-cell contents is 32,000 characters. However, Access outputs a report to Excel 5.0/95 format, in which the maximum length of text-cell contents is 255.
Microsoft provides programming examples for illustration only, without warranty 
either expressed or implied, including, but not limited to, the implied warranties of 
merchantability and/or fitness for a particular purpose. This article assumes that you 
are familiar with the programming language being demonstrated and the tools used to 
create and debug procedures. Microsoft support professionals 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 needs. If you have limited 
programming experience, you may want to contact a Microsoft Certified  Solution Provider 
or the Microsoft fee-based consulting line at (800) 936-5200. For more information about
Microsoft Certified Solution Providers, please see the following page on the World Wide Web:
http://www.microsoft.com/mcsp/For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/overview/overview.asp
=Mid([Notes],1,250)After you have output the report to a spreadsheet, you can reassemble the segments of the Memo field. For example, the segments of the Memo field of the first record appear in cells B2, C2, and D2 respectively. You can reassemble the Memo field by typing the following formula in another cell, E2:
=Mid([Notes],251,250)
=Mid([Notes],501,250)
=CONCATENATE(B2,C2,D2) )You can then copy this formula to the rest of the cells in column E to reassemble the Notes field for all of the records.
=CONCATENATE(B2:D2) )The address of every cell whose contents you want to include in the concatenated result must be listed separately.
Function MemoSplitter(strReportName As String, _
   strFieldName As String, lngMemoLength As Long)
   Dim NewControl As Control
   Dim intLoopCount As Integer
   For intLoopCount = 0 To lngMemoLength / 250
      Set NewControl = CreateReportControl(strReportName, _
         acTextBox, acDetail)
      NewControl.Name = intLoopCount & "MemoText"
      NewControl.ControlSource = "=Mid([" & _
         strFieldName & "]," & 250 * intLoopCount + 1 _
         & ",250)"
   Next intLoopCount
End Function 
?MemoSplitter("rptMemoOutput","Notes",5200) =VALUE(LEFT(A1,FIND("M",A1,1)-1))
=CONCATENATE(A3,B3,C3,D3,E3,F3,G3,H3,I3,J3,K3,L3,M3,N3,O3,P3,Q3,R3,S3,T3,U3)
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.
   Table: tblMemoOutput
   --------------------
   Field Name: ID
   Data Type: Text
   Field Name: Notes
   Data Type: Memo 
   ID   Notes
   --   -----
   a    a
   b    b
   c    c 
Function FillMemo(strTableName As String, _
   strFieldName As String)
   Dim db As Database
   Dim rs As Recordset
   Dim intLoopCount As Integer
   Set db = CurrentDb
   Set rs = db.OpenRecordset(strTableName)
   Do Until rs.EOF
      rs.Edit
      For intLoopCount = 1 To 26
         rs(strFieldName) = rs(strFieldName) _
            & String(200, Chr(intLoopCount + 64))
      Next intLoopCount
      rs.Update
      rs.MoveNext
   Loop
   db.Close
End Function
 
?FillMemo("tblMemoOutput","Notes") =LEN(B2)Note that the data in the Notes field has been truncated to 255 characters.
For more information about loading the output of a report into Microsoft Excel, click Microsoft Access Help on the 
Help menu, type "outputting data" in the Office Assistant or the Answer Wizard, 
and then click Search to view the topics returned.
Additional query words: blob
Keywords          : kbdta OtpProb OtpExl RptProb 
Version           : WINDOWS:2000
Platform          : WINDOWS 
Issue type        : kbbug Last Reviewed: July 13, 1999