Search code examples
ms-accessms-access-2016

Unable to view Navigation and Ribbon in MS Access DB


I've inherited an MS Access project and I'm trying to make changes to some of the forms. However, when I open the file in MS Access 2016, I'm not able to see the navigation menu, top ribbon, or the edit design in order to make any changes. I've searched that there are several ways to bypass this but also found out that each one of them can be disallowed by the developer. If each one can be disallowed, how would another developer make changes?

Below is what I've tried:

  • Pressed F11 but nothing shows up
  • Keep SHIFT clicked while double clicking the file but nothing shows up
  • Pressed CTRL+G to open VBE but nothing shows up

Are there any other ways for me to view edit, navigation, ribbon menus on this access database so that I can make changes to it?


Solution

  • Yes, you can easily bypass such "security" measures using OLE automation.

    Use the following code from another Access database (or VBA application)

    Public Sub UnlockAccess()
        Dim pathToFile As String
        pathToFile = "C:\Path\To\My\File.accdb"
        Dim db As DAO.Database
        Set db = DBEngine.OpenDatabase(pathToFile)
        'Set some restrictive properties back to normal
        On Error Resume Next
        db.Properties!StartUpShowStatusBar = True
        db.Properties!AllowFullMenus = True
        db.Properties!AllowShortcutMenus = True
        db.Properties!AllowBuiltInToolbars = True
        db.Properties!AllowSpecialKeys = True
        db.Properties!AllowToolbarChanges = True
        db.Properties!AllowByPassKey = True
        db.Close
        On Error GoTo 0
        Stop 'You can open up the database using the shift bypass key here, and enable whatever you want'
        Dim app As New Access.Application
        app.OpenCurrentDatabase pathToFile
        app.Visible = True
        app.UserControl = True
        app.DoCmd.SelectObject acTable, , True
    End Sub
    

    An alternate way to modify security is to modify the restrictive VBA code. If you can't open the editor directly from the file, you can open another file, set a reference to the file you want to modify, and modify it from there.