S
Secret Squirrel
I have recently been experimenting with hiding various menus/toolbars via VBA from within my startup
form.
1. I have now completely lost the Visual Basic toolbar (display debug window, display object
browser, compile, etc.). When looking in the "Customize" options dialog for the toolbars, there is
no longer a Visual Basic toolbar listed. Even after clicking Reset.
I've tried various settings within VBA to try and reverse whatever I've done, but without success.
How can I get this toolbar back?
2. Sometimes, the main menu list (menu bar?) disappears. I've tried using CTRL+F11 to make it
appear again, but sometimes this works and sometimes (mostly) it doesn't.
3. The control box (min/restore/max) for the main database pane (Tables, Queries, Forms, Reports,
Macros, Modules tabs) sometimes vanishes. How can I restore these control buttons?
4. Sometimes every menubar/toolbar disappears - all I can see is the main database/application title
bar. This is my intended appearance for when displaying my initial splash screen at startup, but
none of my VBA code seems to bring back the standard built-in menu/toolbars.
My overall objective to clear all these problems is to bring back ALL the standard built-in
menu/toolbars.
The code I've used is:-
----------------------------------------------------------- code begins
Dim myMenuBar As Object, strMeName As String
Private Sub Form_Timer()
DoCmd.ShowToolbar "Database", acToolbarYes
DoCmd.ShowToolbar "Menu Bar", acToolbarYes
Application.MenuBar = ""
DoCmd.Close acForm, "frm_SplashIntro", acSaveNo
End Sub
Private Sub Form_Activate()
On Error Resume Next
Set myMenuBar = CommandBars.ActiveMenuBar
With myMenuBar
.Enabled = False
.Visible = False
End With
DoCmd.ShowToolbar "Database", acToolbarNo
DoCmd.ShowToolbar "Form View", acToolbarNo
DoCmd.ShowToolbar "Menu Bar", acToolbarNo
DoCmd.ShowToolbar "Form Design", acToolbarNo
DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarNo
End Sub
Private Sub Form_Deactivate()
On Error Resume Next
Set myMenuBar = CommandBars.ActiveMenuBar
With myMenuBar
.Enabled = True
.Visible = True
End With
DoCmd.ShowToolbar "Database", acToolbarYes
DoCmd.ShowToolbar "Menu Bar", acToolbarYes
Application.MenuBar = ""
DoCmd.ShowToolbar "Form View", acToolbarWhereApprop
DoCmd.ShowToolbar "Form Design", acToolbarWhereApprop
DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarWhereApprop
DoCmd.Close acForm, "frm_SplashIntro", acSaveNo
End Sub
----------------------------------------------------------- code ends
Can anyone help/advise please?
form.
1. I have now completely lost the Visual Basic toolbar (display debug window, display object
browser, compile, etc.). When looking in the "Customize" options dialog for the toolbars, there is
no longer a Visual Basic toolbar listed. Even after clicking Reset.
I've tried various settings within VBA to try and reverse whatever I've done, but without success.
How can I get this toolbar back?
2. Sometimes, the main menu list (menu bar?) disappears. I've tried using CTRL+F11 to make it
appear again, but sometimes this works and sometimes (mostly) it doesn't.
3. The control box (min/restore/max) for the main database pane (Tables, Queries, Forms, Reports,
Macros, Modules tabs) sometimes vanishes. How can I restore these control buttons?
4. Sometimes every menubar/toolbar disappears - all I can see is the main database/application title
bar. This is my intended appearance for when displaying my initial splash screen at startup, but
none of my VBA code seems to bring back the standard built-in menu/toolbars.
My overall objective to clear all these problems is to bring back ALL the standard built-in
menu/toolbars.
The code I've used is:-
----------------------------------------------------------- code begins
Dim myMenuBar As Object, strMeName As String
Private Sub Form_Timer()
DoCmd.ShowToolbar "Database", acToolbarYes
DoCmd.ShowToolbar "Menu Bar", acToolbarYes
Application.MenuBar = ""
DoCmd.Close acForm, "frm_SplashIntro", acSaveNo
End Sub
Private Sub Form_Activate()
On Error Resume Next
Set myMenuBar = CommandBars.ActiveMenuBar
With myMenuBar
.Enabled = False
.Visible = False
End With
DoCmd.ShowToolbar "Database", acToolbarNo
DoCmd.ShowToolbar "Form View", acToolbarNo
DoCmd.ShowToolbar "Menu Bar", acToolbarNo
DoCmd.ShowToolbar "Form Design", acToolbarNo
DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarNo
End Sub
Private Sub Form_Deactivate()
On Error Resume Next
Set myMenuBar = CommandBars.ActiveMenuBar
With myMenuBar
.Enabled = True
.Visible = True
End With
DoCmd.ShowToolbar "Database", acToolbarYes
DoCmd.ShowToolbar "Menu Bar", acToolbarYes
Application.MenuBar = ""
DoCmd.ShowToolbar "Form View", acToolbarWhereApprop
DoCmd.ShowToolbar "Form Design", acToolbarWhereApprop
DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarWhereApprop
DoCmd.Close acForm, "frm_SplashIntro", acSaveNo
End Sub
----------------------------------------------------------- code ends
Can anyone help/advise please?