Pass criteria to a query design

  • Thread starter Thread starter Chris K
  • Start date Start date
C

Chris K

I have a letter merged to a query in my database

Depending upon a date chosen by the user I would like to pass that date as
criteria to my query

I can define the whole SQL statement:

With CurrentDb.QueryDefs("StdQuery")
.SQL = "SELECT [clients].* From [clients] WHERE [start date] >
Date() AND [Letter Sent] Is Null"
End With

but is it possible just to pass the criteria part?
 
There may be tools available that do it, but there are many
obstacles to writing your own, such as delimiters (WHERE doesn't
have to be delimited with spaces), subqueries, and the fact that
JET allows reserved words (such as WHERE) in other places (such as
field names or parameters.)

....As well as there possibly being subqueries anywhere (in the
SELECT, the FROM or the WHERE clause).
 
Back
Top