Button to open a Query

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
 
G

Guest

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.
 
T

Tom Ross

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

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