Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2002
    Location
    Island of Dots
    Posts
    316

    Unanswered: Getting rid of all Menu and Command Bars

    I am using the following code to remove all Command Bars from an Access application:

    Code:
        Application.CommandBars("Menu Bar").Controls("File").Visible = False
        Application.CommandBars("Menu Bar").Controls("View").Visible = False
        Application.CommandBars("Menu Bar").Controls("Insert").Visible = False
        Application.CommandBars("Menu Bar").Controls("Tools").Visible = False
        Application.CommandBars("Menu Bar").Controls("Format").Visible = False
        Application.CommandBars("Menu Bar").Controls("Records").Visible = False
        Application.CommandBars("Menu Bar").Controls("Edit").Visible = False
        Application.CommandBars("Menu Bar").Controls("Window").Visible = False
        Application.CommandBars("Menu Bar").Controls("Help").Visible = False
    However, I'm still getting a bar of some sort, with no options on it but a restore button, as seen here:

    click here to see...

    Does anyone know how I can get rid of this grey bar? It allows me to move it around, and redock it, but nothing more.

  2. #2
    Join Date
    Feb 2004
    Posts
    137
    Code:
    DoCmd.ShowToolbar "Menu Bar", acToolbarNo

  3. #3
    Join Date
    Jul 2002
    Location
    Island of Dots
    Posts
    316
    Great, thanks for that.

  4. #4
    Join Date
    Jul 2004
    Posts
    6

    You might find this an interesting alternative to the static solution

    Function HideSystem()
    Dim cb
    On Error Resume Next
    For Each cb In CommandBars
    DoCmd.ShowToolbar cb.Name, acToolbarNo
    Next
    On Error GoTo 0
    End Function

  5. #5
    Join Date
    Jul 2002
    Location
    Island of Dots
    Posts
    316
    Thanks for that. However, I notice that it disables the menus for all subsequent instances of Access. Is there any way to do this with just the current instance of Access that the code runs in?

Posting Permissions

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