Button to open a Query

  • Thread starter Thread starter Tom Ross
  • Start date Start date
T

Tom Ross

Hi

I want to open a query from a button on the form. I want to set the WHERE
clause based on other information on the form.
I have generated the SQL string but:

docmd.openquery wants the name of an existing query that does not give me
the oppurtunity to set the SQL from my form info

docmd.runsql will not do a SELECT query, only action query

docmd.runmacro allows a macro to select the named query but doesn't let me
cusomize the SQL based on my form info

What option have I not tried? It must be a simple action

thanks

Tom
 
It depends on what you are going to do with the results of the query.
Normally I open a recordset on the results of a query but that may not be
what you want to do.

Dorian.
 
I want to have the query display on the screen
as would happen with docmd.openquery "queryname"
 
Back
Top