Microsoft KB Archive/311114

= ACC2002: Expression Builder Causes Error with Strings That Are More Than 1,023 Characters Long =

Article ID: 311114

Article Last Modified on 9/25/2003

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q311114



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

This article applies only to a Microsoft Access database (.mdb).

For a Microsoft Access 2000 version of this article, see 305532.



SYMPTOMS
You are using the Expression Builder to create an expression for an event property. The expression that you create is between 1,024 and 2,048 characters long. When you then do one of the following
 * you click OK in the Expression Builder

-or-
 * you move the focus from the event property box after you click OK

you receive the following error message:

An expression can't be longer than 2,048 characters.

The Microsoft Access Help files do not indicate that there is a limit on how long an expression can be. This limit is also not consistent with the limit of the object receiving the expression.



RESOLUTION
To work around this problem, limit expressions that you create in the Expression Builder to 1,023 or fewer characters.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
An event property can handle a maximum string size of 2,048 bytes. However, Access stores the string characters in a two-byte Unicode format. Therefore, the effective maximum length of an expression is 1,024 characters.

Steps to Reproduce the Behavior

 * 1) Start Microsoft Access.
 * 2) Open the sample database Northwind.mdb.
 * 3) In the Database window, click Forms under Objects, and then click New.
 * 4) In the New Form dialog box, click Design View, and then click OK.
 * 5) Right-click in the detail section of the new form, and then click Build Event.
 * 6) In the Choose Builder dialog box, click Expression Builder, and then click OK.
 * 7) In the Expression Builder, create any expression that is at least 1,024 characters long.
 * 8) Click OK to close the Expression Builder. Note that you receive the error message that is mentioned in the &quot;Symptoms&quot; section of this article.

Keywords: kberrmsg kbbug kbnofix KB311114

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.