Change criteria in query during runtime

marathonlady

Registered User.
Local time
Today, 18:40
Joined
Jul 10, 2002
Messages
120
Is it possible to change criteria in a query during runtime?
Based on what the user asks for I have to do this.

Thanks in advance.
 
Here's what I mean by change criteria

My query now has for criteria the following:

WHERE (((ISTSelectedDepartmentCodes.[Selected?])=True)) OR (((ISTSelectedDepartmentCodes.DeptCode) Is Null))

For some instances I need the query to leave off the stmt after the OR (just do up to the "=True"). This is dependent on what the user enters on the filter form that runs the report.

I know about buiding sQL and using queryDef, etc. but this query has alot of fields and it would be a pain to build in the code, I mean to type it out and get the syntax correct, etc. So is there a way to get into this query through the query collection? and take off the part of the WHERE I dont want for certain instances?

I hope you understand this.

Thanks.
 
I'm only aware of the first method , actually I've got an example that does most of the work for you, allowing which fields etc to select, it's too big to post here, but I think Hayley Baxter has posted similar examples here
 
Last edited:

Users who are viewing this thread

Back
Top Bottom