Hi!
I've been trying to invoke a report with a condition
based on the user's choices in a multi-select
listbox on a form.
The listbox contains names of customers (a few
hundreds), and the report shows their details.
Now, I've written an event procedure for a command
button, which builds the proper WHERE clause
for the report's query and then opens the report
using DoCmd.OpenReport function with the constructed
where condition (the last argument).
The problem is that when I choose (too?) many entries in the listbox, the OpenReport function
generates the following error:
Error number: 7769.
The filter operation was canceled. The filter would be
too long.
I consulted Help, and it says that from VBA I can
set the where condition argument to be maximum
~32000 characters. My condition is much smaller than that
and it still wouldn't work. Why does the error message
says something about filter. I'm not trying to FILTER
the query, I'm trying to apply a WHERE condition to it.
Any ideas as to why this doesn't work?
How I can use a very long WHERE condition in a report's
query (using DoCmd.OpenReport)?
Has anyone encountered this kind of problem?
Thanks,
sosed.
I've been trying to invoke a report with a condition
based on the user's choices in a multi-select
listbox on a form.
The listbox contains names of customers (a few
hundreds), and the report shows their details.
Now, I've written an event procedure for a command
button, which builds the proper WHERE clause
for the report's query and then opens the report
using DoCmd.OpenReport function with the constructed
where condition (the last argument).
The problem is that when I choose (too?) many entries in the listbox, the OpenReport function
generates the following error:
Error number: 7769.
The filter operation was canceled. The filter would be
too long.
I consulted Help, and it says that from VBA I can
set the where condition argument to be maximum
~32000 characters. My condition is much smaller than that
and it still wouldn't work. Why does the error message
says something about filter. I'm not trying to FILTER
the query, I'm trying to apply a WHERE condition to it.
Any ideas as to why this doesn't work?
How I can use a very long WHERE condition in a report's
query (using DoCmd.OpenReport)?
Has anyone encountered this kind of problem?
Thanks,
sosed.