Anyone know how to set the query's Filter and Orderby properties from VBA?
I am getting user defined filter and sorting info from a form which gives the user the option to launch either the report or the query. I can pass the filter and orderby to the report.
In order to get the query to work, I had to make a form in datasheet mode so that I can pass the filter and orderby to it.
I see in the query's properties that a filter and orderby property exist, but can't find how to set them.
I don't want to redefine the where and Orderby clause of the SQL itself, mainly because the where may have other criteria the user isn't allowed to change, and I don't want to mess with it.
I also notice that the report runs relatively quickly (30 secs) but the query and the form based on the query take over twice as long. The query is simple, a link to an Oracle view. Both the form and the report are based on the same query. The report is not summarizing or grouping at all.
Any ideas?
I am getting user defined filter and sorting info from a form which gives the user the option to launch either the report or the query. I can pass the filter and orderby to the report.
In order to get the query to work, I had to make a form in datasheet mode so that I can pass the filter and orderby to it.
I see in the query's properties that a filter and orderby property exist, but can't find how to set them.
I don't want to redefine the where and Orderby clause of the SQL itself, mainly because the where may have other criteria the user isn't allowed to change, and I don't want to mess with it.
I also notice that the report runs relatively quickly (30 secs) but the query and the form based on the query take over twice as long. The query is simple, a link to an Oracle view. Both the form and the report are based on the same query. The report is not summarizing or grouping at all.
Any ideas?