Re: How to get around "filter too long" run-time error?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"John Griffiths" wrote:

<snip>

> Could you show your "OpenReport " line?
>
> There is a parameter "FilterName" and a parameter "WhereCondition".
> WhereCondition has a max of 32768 characters
> 32768 / 95 gives you over 340 characters per selected id to play with.

This is what I found when I googled the error number:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;207615

But, now I'm up against another wall.
=======================================================
Method 1
Instead of using the wherecondition argument, use the filtername argument of
the OpenReport method to pass the name of a saved query. This method allows
you to filter a report without limitation on the size of the WHERE clause.
=======================================================
How do I go about doing this from my current set-up?
How do I save a query from the form with the selected list items?

Here's what I think the steps would be:

1. In the OnClick event of the button on the form that runs the report,
somehow save/specify a query with the selected list items.
2. Open the report with the name of the query.

I guess my issue is I have no idea how to do 1.

Any help would be appreciated.

Thanks.

-Amit


-Amit
.



Relevant Pages

  • Re: problem with form...
    ... If yes, you only need one report, and one query, or no ... > WhereCondition argument in the DoCmd.OpenReport. ... > This will produce a message for the user and cancel opening the report, ...
    (microsoft.public.access.forms)
  • Re: Create Report Using Form Parameters
    ... It might be easier to omit the WHERE clause from the query, and build a string to use in the WhereCondition of OpenReport. ... The last one applies its filter to a form, but creating the filter string for a report is identical. ...
    (microsoft.public.access.forms)
  • Re: Selections on Report
    ... If the report is based on a Totals query, you can use this technique on the fields that have Group By in the Total row in query design. ... If you need to be able to do that, you can either use a mix of both techniques (the WhereCondition for the Group By fields, and the query parameters for the Where fields), or you can build the entire SQL statement in the Open event of the report, and assign it to the report's RecordSource. ... There's a downloadable example that shows how to make a search form like ...
    (microsoft.public.access.reports)
  • Re: Query criteria that isnt bound to a single form or report
    ... Megan, to make it flexible, leave the criteria out of the query. ... use the WhereCondition of OpenReport. ... Each form can then build its own critiera, and re-use the same report. ...
    (comp.databases.ms-access)
  • Re: OpenReport Method
    ... Let's say I run a report like so: ... When the report is running the OnOpen event, I want to see what the value of ... >>Is there a way to access the wherecondition parameter from the OpenReport ...
    (microsoft.public.access.reports)