> Example data won't really help, it's just a bunch of text. The first X
> rows of data have less than 255 characters in the field, but then many
> of the following rows have well over 255 (some 2,000+).
On Jun 14, 4:02 am, Stefan Hoffmann <stefan.hoffm...@explido.de>
wrote:
> hi Larry,
>
[quoted text clipped - 11 lines]
> mfG
> --> stefan <--
The TransferSpreadsheet command looks like the following:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
mstrQueryName, Me.txtExportFile, True, ""
One of the queries has a column that is the result of a function,
which similar columns from child records. This is the FIELD definition
for that field in the query:
CombinedLog: CombineLogDesc([TicketID])
The CombineLogDesc function takes the ID of related records and pulls
them together so they appear as one large value.
Public Function CombineLogDesc(intID As Integer) As String
Dim dbs As Database
Dim rst As Recordset
Dim strCombined As String, _
strSeparator As String
strSeparator = Chr$(13) & Chr$(10)
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("SELECT Desc, LogDate from tblLog
where TicketID = " & intID & _
" Order by LogID desc")
With rst
Do Until .EOF
If Not IsNull(.Fields("Desc")) Then
strCombined = strCombined & strSeparator & String(25,
"-") & .Fields("LogDate") _
& Chr$(13) & Chr$(10) & .Fields("Desc")
End If
.MoveNext
Loop
End With
If Len(strCombined) > Len(strSeparator) Then
strCombined = Mid(strCombined, Len(strSeparator) + 1)
End If
CombineLogDesc = strCombined
End Function
Example of truncated text.
============THE FOLLOWING COMES FROM THE QUERY, 438
CHARACTERS============
-------------------------10/18/2006 8:47:08 AM
""Holds"" is a method in xxxxxxx to allow documents to be imported but
held from user access. We could use this for large bulk imports where
doc control wants to validate the results before releasing the
documents to the project.
-------------------------9/14/2006 11:25:14 AM
""Holds"" are a DMS functionality that yyyyyyy is not using.
-------------------------9/6/2006 3:34:37 PM
Report to zz
==========================================================================
==THE FOLLOWING COMES FROM THE SPREADSHEET AFTER EXPORT, 255
CHARACTERS===
-------------------------10/18/2006 8:47:08 AM
""Holds"" is a method in xxxxxxxx to allow documents to be imported
but held from user access. We could use this for large bulk imports
where doc control wants to validate the results before releasing the
docum
==========================================================================
Stefan Hoffmann - 15 Jun 2007 09:38 GMT
hi Larry,
Larry wrote,
> One of the queries has a column that is the result of a function,
> which similar columns from child records. This is the FIELD definition
> for that field in the query:
> CombinedLog: CombineLogDesc([TicketID])
I see, you were right with using a temporary table.
mfG
--> stefan <--