Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / February 2006

Tip: Looking for answers? Try searching our database.

How do I run a query from the switchboard

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sandy - 28 Feb 2006 19:57 GMT
I built a number of queries that I want o add as a submenu to my switchboard.
I can't figure out how to run a query at all from a switchboard
KARL DEWEY - 28 Feb 2006 21:28 GMT
Make a backup copy of your database first!

Click the menu TOOLS - Analyze - Documentor.  Select Forms - Switchboard.  
Click on Options and select only Code.  Run and view in MS Word.  Scroll down
until you see something like this.  It list the command you can run from the
switchboard.

    77    Private Function HandleButtonClick(intBtn As Integer)
    78    ' This function is called when a button is clicked.
    79    ' intBtn indicates which button was clicked.
    80
    81       ' Constants for the commands that can be executed.
    82       Const conCmdGotoSwitchboard = 1
    83       Const conCmdOpenFormAdd = 2
    84       Const conCmdOpenFormBrowse = 3
    85       Const conCmdOpenReport = 4
    86       Const conCmdCustomizeSwitchboard = 5
    87       Const conCmdExitApplication = 6
    88       Const conCmdRunMacro = 7
    89       Const conCmdRunCode = 8
    90       Const conCmdOpentableEdit = 9
    91       Const conCmdOpenFormView = 10
    92       Const conCmdOpenFormData = 11
    93
    94       ' An error that is special cased.
    95       Const conErrDoCmdCancelled = 2501
    96       
    97       Dim dbs As Database
    98       Dim rst As Recordset
    99
    100    On Error GoTo HandleButtonClick_Err

Open the table named Switchboard Items and add to the table.  The first two
fields are for the screen number (SwitchboardID) and button number
(ItemNumber).  Third field is the label for the button.  The number of the
command goes in the Command field and the name of your query in the Argument
field.

Make sure to test all buttons and wait awhile before you toss the backup copy.

> I built a number of queries that I want o add as a submenu to my switchboard.
>  I can't figure out how to run a query at all from a switchboard
fredg - 28 Feb 2006 21:45 GMT
> I built a number of queries that I want o add as a submenu to my switchboard.
>  I can't figure out how to run a query at all from a switchboard

If you are using the Switchboard created by the bui;t-in Switchboard
Manager, the easiest way is the create either a macro to open the
query, or use code in a Module:

Public Sub RunAQuery()
DoCmd.OpenQuery "QueryName"
End Sub

Then use the Switchboard manager to edit the Switchboard command to
either RunMacro or RunCode. Indicate the macro name or the code  Sub
name (RunAQuery).
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.