Hi All - I had a simple little VBA code written that works for MS Access 2003 but not for 2007. I believe it has to do with the menu names. Basically it was a list box that toggled the menus on and off. Here is the working code that I've tried to tweak by adding 'yes visible' for anything under the sun.
I tried also adding menu names that I thought were obvious ('Create' menu 'External Data' menu and so on) but it bombs out saying it cannot find those menus. So you'll see below I've commented those out. That big list of menus doesn't turn anything up, but we still have the odd 2003 user so I've kept them in.
As it stands now, clicking on the list box hides and unhides the 'Home' menu, but I also want it to show the other standard menus that appear when you open Access normally ('Create' 'External Data' and 'Database Tools' are the ones missing).
So as far as I can tell, I just need those standard menu names but can't find them. Help!
I tried also adding menu names that I thought were obvious ('Create' menu 'External Data' menu and so on) but it bombs out saying it cannot find those menus. So you'll see below I've commented those out. That big list of menus doesn't turn anything up, but we still have the odd 2003 user so I've kept them in.
As it stands now, clicking on the list box hides and unhides the 'Home' menu, but I also want it to show the other standard menus that appear when you open Access normally ('Create' 'External Data' and 'Database Tools' are the ones missing).
So as far as I can tell, I just need those standard menu names but can't find them. Help!
Code:
Private Sub listVisible_AfterUpdate()
Dim intVisible As Single
intVisible = Me.listVisible
If intVisible = 1 Then
DoCmd.ShowToolbar "Menu Bar", acToolbarYes
DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarYes '----yes to this
DoCmd.ShowToolbar "Form View", acToolbarYes '----yes to this
DoCmd.ShowToolbar "Toolbox", acToolbarYes
DoCmd.ShowToolbar "Database", acToolbarYes
DoCmd.ShowToolbar "Ribbon", acToolbarYes
' DoCmd.ShowToolbar "Create", acToolbarYes
' DoCmd.ShowToolbar "External Data", acToolbarYes
' DoCmd.ShowToolbar "Database Tools", acToolbarYes
DoCmd.ShowToolbar "Menu Bar", acToolbarYes
DoCmd.ShowToolbar "Database", acToolbarYes
DoCmd.ShowToolbar "Relationship", acToolbarYes
DoCmd.ShowToolbar "Table Design", acToolbarYes
DoCmd.ShowToolbar "Table Datasheet", acToolbarYes
DoCmd.ShowToolbar "Query Design", acToolbarYes
DoCmd.ShowToolbar "Query Datasheet", acToolbarYes
DoCmd.ShowToolbar "Form Design", acToolbarYes
DoCmd.ShowToolbar "Form View", acToolbarYes
DoCmd.ShowToolbar "Filter/Sort", acToolbarYes
DoCmd.ShowToolbar "Report Design", acToolbarYes
DoCmd.ShowToolbar "Print Preview", acToolbarYes
DoCmd.ShowToolbar "Toolbox", acToolbarYes
DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarYes
DoCmd.ShowToolbar "Formatting (Datasheet)", acToolbarYes
DoCmd.ShowToolbar "Macro Design", acToolbarYes
DoCmd.ShowToolbar "Utility 1", acToolbarYes
DoCmd.ShowToolbar "Utility 2", acToolbarYes
DoCmd.ShowToolbar "Web", acToolbarYes
DoCmd.ShowToolbar "Source Code Control", acToolbarYes
DoCmd.ShowToolbar "Ribbon", acToolbarYes
Else
DoCmd.ShowToolbar "Menu Bar", acToolbarNo
DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarNo '----yes to this
DoCmd.ShowToolbar "Form View", acToolbarNo '----yes to this
DoCmd.ShowToolbar "Toolbox", acToolbarNo
DoCmd.ShowToolbar "Database", acToolbarNo
DoCmd.ShowToolbar "Ribbon", acToolbarNo
End If
End Sub