Search code examples
ms-accessreportms-access-2016

Access report text box only displays 255 characters of a longer query result


I have what seems to be a common issue but the specifics are a bit different than other questions available. Working in a MS Access 2016 database on Windows 10.

I have a query performing a UDP function Coalesce which combines Long Text from multiple records into a single String. The query does not appear to be limited in size at all - I can view the correct output of hundreds of characters.

However when i try to display this in a report, in a text box with Can Grow, only the first 255 characters are visible. (Text box is growing correctly)

There is no formatting at all set to this text box, and it is set to Plain Text (so it can shrink, which apparently Rich Text cannot do. Also Rich text has the same problem)

Many solutions center around getting the query to return more than 255 characters (Why a Long Text field is returning only 255 characters in a MS ACCESS 2013 query?) - I do not have this problem. The query is ok.

Many solutions center around a record source from a table of type Short Text, or a query from a Short Text field (Access report field truncating at 255 characters). This is also not my problem since a) the original source field is long text, it is processed through a UDP which outputs a String type, and the query result is >255 characters.

Help!


Solution

  • If the report RecordSource is a query that references the query with the concatenation, you may encounter the bug described by Allen Browne's ConcatRelated function article http://allenbrowne.com/func-concat.html where he offers possible solution.

    However, the function can be called from a textbox or in another VBA procedure. Options to try so results are not passed query to query:

    1. reference query object with the concatenation by name directly as RecordSource

    2. construct SQL statement with the concatenation function directly in RecordSource

    3. call concatenation function directly in textbox