ACC2: Query Generates "Field Length Is Too Long" Error Message

Last reviewed: May 7, 1997
Article ID: Q128114
The information in this article applies to:
  • Microsoft Access version 2.0

SYMPTOMS

Novice: Requires knowledge of the user interface on single-user computers.

When you reference a form memo field in a query using the syntax

   Forms![Formname]![Controlname]

you receive the error message:

   Field length is too long.

CAUSE

This behavior can occur if the memo field contains more than 255 characters. Microsoft Access assumes that the control being referenced in the query is a text field, rather than a memo field, and text fields are limited to 255 characters.

RESOLUTION

Reference the memo field indirectly by calling an Access Basic function in the query that returns the field's contents. The following sample user- defined function demonstrates how to reference a memo control indirectly:

   Function My_Memo()
      My_Memo = Forms![Formname]![Controlname]
   End Function

To call this function, replace the "Forms![Formname]![Controlname]" reference in the query with the name of the function.

MORE INFORMATION

Steps To Reproduce Behavior

  1. Open the sample database NWIND.MDB.

  2. Create a new form based on the Employees table.

  3. Drag the Notes field from the field list to the form.

  4. Save the form as Memo Lookup. View the form in Form view and then minimize the form.

  5. Create a new query based on the Employees table.

  6. Type "Forms![Memo Lookup]![Notes]" (without quotation marks) in the first column of the query grid.

  7. Run the query. You receive the error message state above.

STATUS

This behavior no longer occurs in Microsoft Access version 7.0.

REFERENCES

Microsoft Access "User's Guide," version 2.0, Appendix A, "Microsoft Access Specifications," page 707


Additional query words: query by form qbf
Keywords : kberrmsg kbusage QryAppnd
Version : 2.0
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
Resolution Type : Info_Provided


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 7, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.