Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
ACC2000: Query Expression Truncated at 511 Characters
Article ID: 239565 - View products that this article applies to.
This article was previously published under Q239565
Moderate: Requires basic macro, coding, and interoperability skills.
This article applies only to a Microsoft Access database (.mdb).
In a Microsoft Access 2000 query, when you try to edit the query in the query design grid, you may receive the following error message:
You then notice that an expression or a critera has been truncated.
The expression you entered is missing a closing parenthesis, bracket (]), or vertical bar (|).
Upon saving the query, you may also see the following error message:
Missing ),] or Item in query expression '<expression>'.
An expression or a criteria in your query is over 511 characters in length. Although Access 2000 Help states that a cell in a query design grid has a limit of 1024 characters, the Access 2000 query design interface actually has a limit of 511 characters. This issue does not occur in earlier versions of Microsoft Access.
To resolve this problem, obtain Microsoft Office 2000 Service Release 1/1a (SR-1/SR-1a).
To obtain SR-1/SR-1a, click the article number below to view the article in the Microsoft Knowledge Base:
245025To temporarily work around this problem, do not try to edit an expression of an existing query in Design view if your SQL statement has more than 511 characters.
(http://support.microsoft.com/kb/245025/EN-US/ )OFF2000: How to Obtain and Install Microsoft Office 2000 Service Release 1/1a (SR-1/SR-1a)
If you want to create a query with an expression that exceeds 511 characters, you can use the CreateQueryDef method in a Visual Basic for Applications procedure. The following example illustrates how to do this with the example from the "Steps to Reproduce Problem" section:
The query that you created in this example can be run, but its expression cannot be edited through the interface if it has more than 511 characters. To make changes that require an expression greater than 511 characters, create a new query with the changes you need by once again using the CreateLongQuery procedure.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was corrected in Microsoft Office 2000 SR-1/SR-1a.
If the query has been imported or converted from an earlier version of Access, it will run but you cannot edit it in Design view.
Steps to Reproduce Problem