Sending criteria to a SQL Pass-Through query

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?
 
R

Rick Brandt

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top