From code directly open query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to open a query directly from the code. For example:

DoCmd.OpenQuery "qryTable01"

Is there a way to highlight "qryTabl01" and have it open the query, or
something similar to that, instead of having to go to the query in the query
tab to open it.

Thank you for your help.

Steven
 
Is there a way to open a query directly from the code. For example:

DoCmd.OpenQuery "qryTable01"

Is there a way to highlight "qryTabl01" and have it open the query, or
something similar to that, instead of having to go to the query in the query
tab to open it.

Thank you for your help.

Steven

I don't understand.
The code

DoCmd.OpenQuery "qryTable01"

will open the query named "qryTable01" when the code is run.
 
Yes, that is not stated correctly.

I want to edit the query in design mode. Is there a fast way to go from the
code to the design mode without having to go to the Query tab and then find
the query.

Thank you for responding.

Steven
 
The following codes opens the query in design mode. Is this what you
are asking?

DoCmd.OpenQuery "SomeQueryName", acViewDesign

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
Thank you for your response.

Not when the code is running ... but...

if I am programming code or reviewing code and I need to look at the query
design I was thinking maybe I can highlight the query name and hit a hot
button to open the query immediately in design mode vs having to go find it
among all the other queries in the query tab.

Thank you,

Steven
 
Thank you for your response.

Not when the code is running ... but...

if I am programming code or reviewing code and I need to look at the query
design I was thinking maybe I can highlight the query name and hit a hot
button to open the query immediately in design mode vs having to go find it
among all the other queries in the query tab.

Thank you,

Steven

No.
Code does not work that way.
 
No.
Code does not work that way.

hmm, just an idea: while in module design mode, hitting F1 gets the
help and F2 gets the list of all objects. Both functions seem to get
the word under the cursor as a parameter. On the other way, creating a
new menu or setting a new symbol on a tool bar allows only to select a
built-in command or an existing macro to be activated. We could write
a macro to open any report in design mode, but how to get the word
under the cursor as the report name?

Now I wonder how Access itself has been implemented. Is there a
library function for every built-in command or they use an internal
macro language?
And anyway, how do they associate a library function with a function-
key to start with?

Greetings
Marco P
 

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

Back
Top