Query to Switchboard?

B

Brent J

Greetings,

I am trying to design a switchboard but I am not
able to show queries? What do I have to do to run queries
from the switchboard?

Thanks,
Brent
 
T

Tom Ellison

Dear Brent:

There are two kinds of queries according to Access terminology:
SELECT queries and Action Queries. When you say "show queries" I must
assume you mean displaying the datasheet of a query, which then must
be a SELECT query.

You can open the datasheet of SELECT query using DoCmd.OpenQuery.
After typing this, press F1 to see how to finish the command
referencing objects from your database.

You can put this code on the click event of a Command Button on any
form, including switchboards.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
J

John Spencer (MVP)

As Tom points out, you cannot do this directly with the standard switchboard
tool that is built-in to Access. You should be using a form to display the
data. That is what forms are designed for.

If you MUST display the select query and you MUST use the built-in switchboard, then
Create a function in a VBA module that will open the specified query. See Tom
Ellison's reply for sample code
DoCmd.OpenQuery "YourQueryName"

Now open the switchboard manager
Use RunCode choice in the switchboard manager
Input the function name in the Function Name box on the switchboard manager
 

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