Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2011
    Posts
    13

    Unanswered: Listing a Query on a Switchboard

    I'm using Access 2010. Following help from this forum, I've discovered how to activate the Switchboard function which is quite handy. Using the Switchboard Manager, it seems I cannot put a Query on the Switchboard.

    Does anyone know if there is a way to get a query to list on the Switchboard?

    Norm C

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You can very easily customize a switchboard for this purpose:
    1. Open the Switchboard form in design view and open its module.

    2. Identify the function , it begins with:
    Code:
    Private Function HandleButtonClick(intBtn As Integer)
    ' This function is called when a button is clicked.
    ' intBtn indicates which button was clicked.
    3. At the end of the Constant declaration section that begins with:
    Code:
        ' Constants for the commands that can be executed.
        Const conCmdGotoSwitchboard = 1
    add this line:
    Code:
        Const conCmdOpenQuery = 10
    4. Further down there is a long section of code that begins with:
    Code:
    Select Case rs![Command]
    and ends with
    Code:
        End Select
    5. In this section of code add these lines before the line beginning with "Case Else":
    Code:
           ' Open a Query   
            Case conCmdOpenQuery
                DoCmd.OpenQuery rs![Argument]
    6. The end of the "Select Case... End Select" section should now looks like:
    Code:
            ' Open a Data Access Page
            Case conCmdOpenPage
                DoCmd.OpenDataAccessPage rs![Argument]
    
            ' Open a Query          
            Case conCmdOpenQuery            
            DoCmd.OpenQuery rs![Argument]
    
            ' Any other command is unrecognized.
            Case Else
                MsgBox "Unknown Option."
        
        End Select
    7. To open a query from the Switchboard, open the table [Switchboard Items], add the name of the query in the column [Argument] and 10 in the column [Command].
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •