Can i use a switchboard to access a query? Also, i have one main
switchboard that allows me to open up two more switchboards - one
which opens up forms and another which opens uses a macro. Is there
any way i can place a piece of text on one of the switchboards
without it apperaing on the other 2?
There is an OpenQuery method. The problem is you appear to be using
the built in switchboard created by the Access Switchboard manager
which does not support the OpenQuery method directly.
Create either a macro to open the query, or write a procedure in a
module:
Public Sub RunQuery()
DoCmd.OpenQuery "QueryName"
End Sub
Then, using the Switchboard manager, edit one of the buttons to either
Run Macro or Run Code, writing the name of the Macro or the Procedure
name (RunQuery) where indicated.
Because the switchboard is really just one form with different
commands taken from the switchboard table, to have the different menus
display different text, you have to first find the name of the current
switchboard and code the text to be visible or false as needed. It's a
pain.
A better long range solution would be to scrap this switchboard and
create a new one (or several new ones) using an unbound form with
command buttons. You'll have better control over it's functionality
and maintenance will be simpler. If you use the wizard to create the
buttons, Access will write most of the code for you.