ACC2000: Error Using More Than 2000 Characters in Wherecondition of OpenReportID: Q207615
|
When you run a procedure that contains the OpenReport method of the DoCmd object, and you use the wherecondition argument to pass a string that contains more than 2000 characters, the report may not open. You may also receive the following error message:
Note that the number of characters in the wherecondition argument that causes this behavior may vary. For example, the problem may not occur until the length of the wherecondition argument exceeds 2048 characters.Run-time error '7769':
The filter operation was canceled. The filter would be too long.
You can use two methods to filter a report without limitation on the size of the WHERE clause.
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.
Sub ReportWhereTest()
Dim strPWhr As String
'Build a Where clause that is 2046 characters long.
strPWhr = "[Phone] in ('" & String(2031, "a") & "')"
'Show how long the WhereCondition is.
MsgBox Len(strPWhr) & " Characters"
'Open the report with the WhereCondition.
DoCmd.OpenReport "rptWhereTest", acViewPreview, , strPWhr
End Sub
For more information about the OpenReport method, in the Visual Basic Editor, click
Microsoft Visual Basic Help on the Help menu, type "OpenReport method" in
the Office Assistant or the Answer Wizard, and then click Search to
view the topic.
Additional query words: pra
Keywords : kberrmsg kbdta MdlProb
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: May 13, 1999