Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The introduced expression exceeds 1.024 allowed characters

Status
Not open for further replies.

Bresart

Programmer
Joined
Feb 14, 2007
Messages
314
Location
ES
Hi, i am doing a filtering in a form creating a query as follows:

Set db = CurrentDb()
Set queryDef = db.QueryDefs("conFiltroGenerico")
queryDef.SQL = "SELECT tblTaxonomia.Id " & _
"FROM tblTaxonomia " & _
"WHERE (" & WhereCondition & ");"
DoCmd.ApplyFilter "conFiltroGenerico"


Sometimes no filter is applied, and when i open the query "conFiltroGenerico" i get the error The introduced expression exceeds 1.024 allowed characters (the WhereCondition string is too long).

I have also tried

DoCmd.ApplyFilter "", WhereCondition

with the same result: no filter is applied.

I have 293 records in the DB, and the final number of records is expected many more.

How could this error be avoided and the filter applied for any records number?

Thanks in advance.
 
How long is WhereCondition

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
Hi KenReay, i haven't count the string, but i have seen the SQL statement in the SQL view of the query and it's about 30-40 lines.

Thanks.
 
The WhereCondition string has 6.517 characters.
 
Well that is more than 1024, and I think you will find that is what your error message is refering to. See Specifications in help for maximum lngth of SQL statement / Filter

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
Thanks KenReay.

I haven't seen anything in the help about that. The only possible solution would be that this limit could be alterable.

Or change the procedure, to that one: the form is based in a table. It had to be changed to a query of the original table and another with only a field (Id), in which the procedure previously had inserted the records that match the filter criteria.

Is there a less arduous way of doing this filtering?
 
See
Attribute Maximum
Number of enforced relationships 32 per table minus the number of indexes that are on the table for fields or combinations of fields that are not involved in relationships
Number of tables in a query 32
Number of fields in a recordset 255
Recordset size 1 gigabyte
Sort limit 255 characters in one or more fields
Number of levels of nested queries 50
Number of characters in a cell in the query design grid 1,024
Number of characters for a parameter in a parameter query 255
Number of ANDs in a WHERE or HAVING clause 99
Number of characters in an SQL statement


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top