Sending criteria to a SQL Pass-Through query

  • Thread starter Thread starter Galen
  • Start date Start date
G

Galen

I have a pass-through query that pulls information from an
IBM DB2 table. The query works fine but I need to be able
to change the date criteria by way of an Access 2000 form
the same way I would in a normal query (i.e. {forms]!
[frmControlPanel].[txtDate]).

What is the easiest way to accomplish this?

Here is the selection criteria line as it appears in the
query currently

....WHERE date(W54U999S.ENDDATTIM) = date('8/31/2004');

I need to be able to change '8/31/2004' to something else
based upon a text box on a form.

Any ideas?
 
Galen said:
I have a pass-through query that pulls information from an
IBM DB2 table. The query works fine but I need to be able
to change the date criteria by way of an Access 2000 form
the same way I would in a normal query (i.e. {forms]!
[frmControlPanel].[txtDate]).

What is the easiest way to accomplish this?

Here is the selection criteria line as it appears in the
query currently

...WHERE date(W54U999S.ENDDATTIM) = date('8/31/2004');

I need to be able to change '8/31/2004' to something else
based upon a text box on a form.

Any ideas?

Your code basically needs to rewrite and replace the SQL string in the
Pass-Thru before executing it.

CurrentDB.QueryDefs("QueryName").SQL = "New SQL String"

You could have a static string and only tack on variable WHERE clauses as
required.
 
Back
Top