Access 2010 hide menu on startup? (1 Viewer)

RichO

Registered Yoozer
Local time
Today, 12:13
Joined
Jan 14, 2004
Messages
1,036
Well, I made the move and am using Access 2010 now and I am running into a couple issues.

First off, I want to get rid of this menu on startup:

Not sure what it's called (ribbon, menu bar, etc). I am able to hide it using

DoCmd.RunCommand acCmdWindowHide
DoCmd.ShowToolbar "Ribbon", acToolbarNo


...in the OnLoad event, but this only works when running the opening form from the form list. When the form runs at startup the menus do not hide.

Also I would still like to have the file menu available because sometimes the user need to access the print menu to choose an alternate printer. I am not finding a straightforward answer online.

Thanks for the help.
 

RichO

Registered Yoozer
Local time
Today, 12:13
Joined
Jan 14, 2004
Messages
1,036
I had already tried that. I used

Code:
'Hides the navigation pane for users who get this as the startup screen
DoCmd.NavigateTo "acNavigationCategoryObjectType"
DoCmd.RunCommand acCmdWindowHide
'hide the tool bar too
DoCmd.ShowToolbar "Ribbon", acToolbarNo

...in the current event of the startup form and it still does not hide the menus when opening the database. It does when I enter with shift+click and then open the form but otherwise, no.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 18:13
Joined
Sep 12, 2006
Messages
15,652
Users can just use F11 to toggle the menu/ribbon off/on, I think, anyway.
 

RichO

Registered Yoozer
Local time
Today, 12:13
Joined
Jan 14, 2004
Messages
1,036
F11 only toggles the "All Access Objects" panel.
 

Eljefegeneo

Still trying to learn
Local time
Today, 10:13
Joined
Jan 10, 2011
Messages
904
I use the code in the ONCurrent event of the form that is opened first. Select a form that you want to appear on start up and put the code in the OnCurrent event, modified, of course, for your particular db.
 

RichO

Registered Yoozer
Local time
Today, 12:13
Joined
Jan 14, 2004
Messages
1,036
That's what I did, tried in both the OnLoad and OnCurrent event. In both cases it hides the ribbon only when opening the form from the form list.
 

Eljefegeneo

Still trying to learn
Local time
Today, 10:13
Joined
Jan 10, 2011
Messages
904
Open DB
Click On file
Select Current DB
Go to the "Display Form" selector
Select the Form that you want to open first. This is the one with the code that prevents the ribbon from being displayed.

Note: You may want to have some sort of button to "unhide" the ribbon on this form, probably known to you.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 18:13
Joined
Feb 19, 2013
Messages
16,607
I use the code in the ONCurrent event of the form that is opened first. Select a form that you want to appear on start up and put the code in the OnCurrent event, modified, of course, for your particular db.
Personally I would use the open event which is the very first bit of code to run
 

RichO

Registered Yoozer
Local time
Today, 12:13
Joined
Jan 14, 2004
Messages
1,036
Open DB
Click On file
Select Current DB
Go to the "Display Form" selector
Select the Form that you want to open first. This is the one with the code that prevents the ribbon from being displayed.
Not sure what you mean by "Open DB" or "Click on file". Open Access by itself and then choose the DB I want to open, or open the actual MDB file?
 

Eljefegeneo

Still trying to learn
Local time
Today, 10:13
Joined
Jan 10, 2011
Messages
904
Open your database, go to options and set the form you want to open first from and insert the code in that form.
 

Eljefegeneo

Still trying to learn
Local time
Today, 10:13
Joined
Jan 10, 2011
Messages
904
Not sure if we are speaking the same language, but I will post a sample tomorrow. Too late tonight.
 

RichO

Registered Yoozer
Local time
Today, 12:13
Joined
Jan 14, 2004
Messages
1,036
Well, my opening form is called "Main". That is selected as the "Display Form" under current database options. In that form I have put the lines of code into the OnCurrent event. Have also tried the OnOpen event. It works when I open that form from the panel containing the list of objects but when it automatically opens as the startup form, the ribbon does not hide.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 18:13
Joined
Feb 19, 2013
Messages
16,607
have you tried removing this line

DoCmd.NavigateTo "acNavigationCategoryObjectType"

I can't see what benefit it provides since you want to hide the navigation window anyway
 

RichO

Registered Yoozer
Local time
Today, 12:13
Joined
Jan 14, 2004
Messages
1,036
Yes, I have tried it with and without that line, same result.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 18:13
Joined
Feb 19, 2013
Messages
16,607
So what is the difference between what you have and this db attached?

The first time you open it, you may get the 'enable' message, just click this and close then reopen

As previously covered, hit F11 to show the object window then you can edit the Main form - the only code is in the open event
 

Attachments

  • Database1.accdb
    388 KB · Views: 134

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 18:13
Joined
Sep 12, 2006
Messages
15,652
rich. did you miss #11

Ctrl + F1 is the key combination.
 

RichO

Registered Yoozer
Local time
Today, 12:13
Joined
Jan 14, 2004
Messages
1,036
I was hoping to hide it without the user having to do it themselves. Ctrl + F1 does the same thing as the arrow in the upper right corner. If I hide the ribbon myself it will not appear but when I am regularly designing and copying over the updated program to the user it's hard to remember to always do that.
 

Users who are viewing this thread

Top Bottom