1

I have an Access database that is set to just show my forms and hide the ribbon and table explorer.
This works fine, except for me.
I want to be able to open the database from a shortcut, just as if I held down the Shift Key to bypass the startup routines.

I detect the command line parameter. I close the login form.

What all do I need to turn on to get back to a fully functioning version of Access without bothering with a shift key?

Here are a couple of candidates that I found from someone who was disabling everything. I need to turn them back on. But, I can't see how this worked in the original, and doesn't work at all for me.

StartUpShowStatusBar = True  // Done
AllowShortcutMenus = True
AllowFullMenus = True
AllowBuiltInToolbars = True
AllowToolbarChanges = True
AllowSpecialKeys = True
UseAppIconForFrmRpt = True
BWhite
  • 713
  • 1
  • 7
  • 24
  • Does this answer your question? [MSAccess - Minimize the Toolbar Ribbon OnLoad()?](https://stackoverflow.com/questions/18240240/msaccess-minimize-the-toolbar-ribbon-onload) – June7 Oct 07 '20 at 22:28
  • @June7 It doesn't seem to. It shows how to hide the ribbon, and doesn't seem to deal with anything else at all. – BWhite Oct 08 '20 at 15:35

2 Answers2

1

You have already seen my answer here to hide ribbon and navigation pane. I am posting here to show them again by clicking a button. Below is both code to hide and then show ribbon and navigation pane.

Codes to hide-

Private Sub Form_Load()
On Error GoTo HarunErrHandler

'******************* Hide Ribbon and Navigation Pane ***************************

    DoCmd.ShowToolbar "Ribbon", acToolbarNo
    Call DoCmd.NavigateTo("acNavigationCategoryObjectType")
    Call DoCmd.RunCommand(acCmdWindowHide)

'*******************************************************************************

Exit Sub
HarunErrHandler:
MessageBox = MsgBox("Error Number: " & Err.Number & vbCrLf & Err.Description, vbInformation, "Error")
End Sub

To show ribbon and left pane-

Private Sub cmdShow_Click()
On Error GoTo HarunErrHandler
    
'******************* Show Ribbon and Navigation Pane ***************************

    DoCmd.ShowToolbar "Ribbon", acToolbarYes
    Call DoCmd.SelectObject(acTable, , True)

'*******************************************************************************

Exit Sub
HarunErrHandler:
MessageBox = MsgBox("Error Number: " & Err.Number & vbCrLf & Err.Description, vbInformation, "Error")
End Sub
Harun24hr
  • 30,391
  • 4
  • 21
  • 36
  • This gives me a ribbon and a main menu. But they both appear to be handicapped. For example, they only have "Home". "Create," "External Data," and "Database Tools" are still AWOL. – BWhite Oct 08 '20 at 15:43
  • We're still not quite there. The "All Access Objects" panel appears on the left, but the context menu doesn't work. Right click and nothing appears. Any ideas? – BWhite Oct 14 '20 at 16:11
0

Based on Harun's answer, I was able to build this, which seems to bring everything back.

Private Sub Form_Load()
On Error GoTo ErrHandler
    If CheckKeyFiles = True Then
        Me!txtUID = "workflow"
        Me!txtSID = GetSID("workflow")
    End If
    Me!txtVersionDate = "Version " & GetVersionDate()
    If Command = "develop" Then
        DoCmd.Close acForm, "Dialog_Login"
        DoCmd.SelectObject acTable, , True
        Application.SetOption "Show Status Bar", True
        CurrentDb.Properties("AllowFullMenus") = True
        CurrentDb.Properties("AllowBuiltInToolbars") = True
        CurrentDb.Properties("AllowToolbarChanges") = True
        CurrentDb.Properties("AllowSpecialKeys") = True
        DoCmd.ShowToolbar "Ribbon", acToolbarYes
    End If
Exit Sub
ErrHandler:
    Dim Response
    Response = MsgBox("Error Number: " & Err.Number & vbCrLf &     Err.Description, vbInformation, "Error")

End Sub
BWhite
  • 713
  • 1
  • 7
  • 24
  • Is there a way to give @harun24hr the credit he deserves and still mark this as the answer? – BWhite Oct 12 '20 at 19:37
  • This effort ultimately failed. I was able to get everything back except the context menu on the Nav pane. If you can't right click and open a Delete or Update query without running it, it is unusable. – BWhite Apr 07 '21 at 18:16