Access 2010 hide menu on startup?

RichO

Registered Yoozer
Local time
Today, 13:14
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:
menu.jpg

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.
 
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.
 
Users can just use F11 to toggle the menu/ribbon off/on, I think, anyway.
 
F11 only toggles the "All Access Objects" panel.
 
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.
 
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.
 
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.
 
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
 
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?
 
Open your database, go to options and set the form you want to open first from and insert the code in that form.
 
Not sure if we are speaking the same language, but I will post a sample tomorrow. Too late tonight.
 
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.
 
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
 
Yes, I have tried it with and without that line, same result.
 
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

rich. did you miss #11

Ctrl + F1 is the key combination.
 
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

Back
Top Bottom