How to turn on the menus in Access 2003

  • Thread starter The Fool on the Hill
  • Start date
T

The Fool on the Hill

Dear All,

I have a database in which I suppress the access menus.

In an earlier thread I see that opening with shift key down or pressing F11
when open should be a solution.

Unfortunately neither seem to work, is there another solution?

Thanks for your help !
 
T

The Code Cage Team

You can turn them on and off using a function, the first turns them off
the second turns them on:

Code:
--------------------
Public Function ToolbarsOff()
On Error GoTo Err_ToolbarsOff

DoCmd.ShowToolbar "Menu Bar", acToolbarNo
DoCmd.ShowToolbar "Database", acToolbarNo
DoCmd.ShowToolbar "Relationship", acToolbarNo
DoCmd.ShowToolbar "Table Design", acToolbarNo
DoCmd.ShowToolbar "Table Datasheet", acToolbarNo
DoCmd.ShowToolbar "Query Design", acToolbarNo
DoCmd.ShowToolbar "Query Datasheet", acToolbarNo
DoCmd.ShowToolbar "Form Design", acToolbarNo
DoCmd.ShowToolbar "Form View", acToolbarNo
DoCmd.ShowToolbar "Filter/Sort", acToolbarNo
DoCmd.ShowToolbar "Report Design", acToolbarNo
DoCmd.ShowToolbar "Print Preview", acToolbarNo
DoCmd.ShowToolbar "Toolbox", acToolbarNo
DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarNo
DoCmd.ShowToolbar "Formatting (Datasheet)", acToolbarNo
DoCmd.ShowToolbar "Macro Design", acToolbarNo
DoCmd.ShowToolbar "Utility 1", acToolbarNo
DoCmd.ShowToolbar "Utility 2", acToolbarNo
DoCmd.ShowToolbar "Web", acToolbarNo
DoCmd.ShowToolbar "Source Code Control", acToolbarNo
DoCmd.ShowToolbar "Visual Basic", acToolbarNo

Exit_ToolbarsOff:
Exit Function

Err_ToolbarsOff:
If Err.Number = 2094 Then 'Can't find the toolbar. You tried to run a macro that includes a ShowToolbar action or a Visual Basic procedure that includes a ShowToolbar method.
Resume Next
Else
MsgBox Err.Number & " - " & Err.Description
Resume Exit_ToolbarsOff
End If

End Function
--------------------


Code:
--------------------
Public Function ToolbarsOn()
On Error GoTo Err_ToolbarsOn

DoCmd.ShowToolbar "Menu Bar", acToolbarYes
DoCmd.ShowToolbar "Database", acToolbarWhereApprop
DoCmd.ShowToolbar "Relationship", acToolbarWhereApprop
DoCmd.ShowToolbar "Table Design", acToolbarWhereApprop
DoCmd.ShowToolbar "Table Datasheet", acToolbarWhereApprop
DoCmd.ShowToolbar "Query Design", acToolbarWhereApprop
DoCmd.ShowToolbar "Query Datasheet", acToolbarWhereApprop
DoCmd.ShowToolbar "Form Design", acToolbarWhereApprop
DoCmd.ShowToolbar "Form View", acToolbarWhereApprop
DoCmd.ShowToolbar "Filter/Sort", acToolbarWhereApprop
DoCmd.ShowToolbar "Report Design", acToolbarWhereApprop
DoCmd.ShowToolbar "Print Preview", acToolbarWhereApprop
DoCmd.ShowToolbar "Toolbox", acToolbarWhereApprop
DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarWhereApprop
DoCmd.ShowToolbar "Formatting (Datasheet)", acToolbarWhereApprop
DoCmd.ShowToolbar "Macro Design", acToolbarWhereApprop
DoCmd.ShowToolbar "Utility 1", acToolbarWhereApprop
DoCmd.ShowToolbar "Utility 2", acToolbarWhereApprop
' DoCmd.ShowToolbar "Web", acToolbarWhereApprop 'I never allow this one because I hight use hyperlinks
DoCmd.ShowToolbar "Source Code Control", acToolbarWhereApprop
DoCmd.ShowToolbar "Visual Basic", acToolbarWhereApprop

Exit_ToolbarsOn:
Exit Function

Err_ToolbarsOn:
If Err.Number = 2094 Then 'Can't find the toolbar. You tried to run a macro that includes a ShowToolbar action or a Visual Basic procedure that includes a ShowToolbar method.
Resume Next
Else
MsgBox Err.Number & " - " & Err.Description
Resume Exit_ToolbarsOn
End If

End Function
--------------------


--
The Code Cage Team

Regards,
The Code Cage Team
www.thecodecage.com
 
Top