Hi All, I'm getting runtime error 2046 "The command or action windowunhide is not available" when I try to run the line of code "DoCmd.RunCommand acCmdWindowUnhide". One of the lines of code (presumably DoCmd.RunCommand acCmdWindowHide) hid most of the menu tabs and almost everything under the "file" tab (except print).
Code:
Public Sub DeveloperMode(IsDeveloper As Boolean)
Dim i As Integer
If IsDeveloper Then DoCmd.ShowToolbar "Ribbon", acToolbarYes
DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowUnhide
Application.SetOption "Show Status Bar", True
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = True
Next i
Else
DoCmd.ShowToolbar "Ribbon", acToolbarNo
DoCmd.NavigateTo "acNavigationCategoryObjectType"
DoCmd.RunCommand acCmdWindowHide
Application.SetOption "Show Status Bar", False
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i
End If
end sub
EDIT: I can get them back easily by opening the database with the shift key, but I need to be able to go back and forth