Solved Cant hide ribbon all the way (1 Viewer)

oxicottin

Learning by pecking away....
Local time
Today, 03:54
Joined
Jun 26, 2007
Messages
856
Hello, I always use:

DoCmd.ShowToolbar "Ribbon", acToolbarNo ' Hide ribbon
AND
DoCmd.ShowToolbar "Ribbon", acToolbarYes ' Show ribbon

To hide on open and unhide on close which I always use but this time its not working completly and leaving this bar at the top, any ideas as to why? Whats weird is if the database is open using the shift/open to get menus ect so I can wor on the DB, if I open the main form I have the acToolbarNo on then it hides everything "Good image" like it's supposed to BUT if I open the DB normally then I get what's showing in the "no good" images.
 

Attachments

  • nogood.JPG
    nogood.JPG
    46.7 KB · Views: 37
  • good.JPG
    good.JPG
    38.1 KB · Views: 36

Gasman

Enthusiastic Amateur
Local time
Today, 08:54
Joined
Sep 21, 2011
Messages
14,301
So something in your startup code?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:54
Joined
May 7, 2009
Messages
19,243
you need a Custom ribbon (on UsysRibbons table) to hide all those ribbon menu.
 

oxicottin

Learning by pecking away....
Local time
Today, 03:54
Joined
Jun 26, 2007
Messages
856
This has happened to me before a long time ago and I can't remember why.... The startup code is no different than any of the other databases I have played with. I tried adding the acToolbarNo in both load and open events and I get the same results. What's weird and got me stumped is I can open the DB in design view and not run the acToolbarNo then open the startup form and the menu is gone, the way it's supposed to BUT if I open it normally then I get a partial menu like in the image.

Do I need to change something in the DB options? (Image added). I think years ago when this same thing happened I resorted in moving everthing into a new Access Database and I created a new main form and it worked from there. I even got rid of all code in the load and open events to see if @Gasman idea of something running stopping it and thats not it either.
 

Attachments

  • menu.JPG
    menu.JPG
    55.6 KB · Views: 30
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 08:54
Joined
Sep 21, 2011
Messages
14,301
Do not get rid of code, just comment it out. :(
 

oxicottin

Learning by pecking away....
Local time
Today, 03:54
Joined
Jun 26, 2007
Messages
856
Do not get rid of code, just comment it out. :(

I just made a DB copy and got rid of everything and still did it.... Don't worry I always make backups and extra ones to work on, I learned my lesson!
 

oxicottin

Learning by pecking away....
Local time
Today, 03:54
Joined
Jun 26, 2007
Messages
856
@Gasman @arnelgp I figured it out I was right, I created a new DB and exported all tables, forms, querys etc. to it and ran it and now the menu at the top is gone as it was supposed to be while open.
 

moi

Member
Local time
Today, 15:54
Joined
Jan 10, 2024
Messages
201
@Gasman @arnelgp I figured it out I was right, I created a new DB and exported all tables, forms, querys etc. to it and ran it and now the menu at the top is gone as it was supposed to be while open.
Can you pls show me how you did it..
 

oxicottin

Learning by pecking away....
Local time
Today, 03:54
Joined
Jun 26, 2007
Messages
856
Can you pls show me how you did it..
Sure....

On your main form (The first form that is opened), just put the VBA below in its on open event.

Code:
Private Sub Form_Open(Cancel As Integer)
    DoCmd.ShowToolbar "Ribbon", acToolbarNo    ' Hide ribbon
End Sub

Now in the same form put the code below its on close event.

Code:
Private Sub Form_Close()
'Dont use in unload event.
    DoCmd.ShowToolbar "Ribbon", acToolbarYes    ' Show the ribbon again
End Sub

Now when opening your database there will be no menus etc. and if you want to open your DB to work on it, while opening the DB hold your SHIFT key down and it will open the DB in design View.

Now in your DB's options uncheck these under navigation and toolbar options..

Capture.JPG


Hope this helps!
 
  • Like
Reactions: moi

moi

Member
Local time
Today, 15:54
Joined
Jan 10, 2024
Messages
201
Sure....

On your main form (The first form that is opened), just put the VBA below in its on open event.

Code:
Private Sub Form_Open(Cancel As Integer)
    DoCmd.ShowToolbar "Ribbon", acToolbarNo    ' Hide ribbon
End Sub

Now in the same form put the code below its on close event.

Code:
Private Sub Form_Close()
'Dont use in unload event.
    DoCmd.ShowToolbar "Ribbon", acToolbarYes    ' Show the ribbon again
End Sub

Now when opening your database there will be no menus etc. and if you want to open your DB to work on it, while opening the DB hold your SHIFT key down and it will open the DB in design View.

Now in your DB's options uncheck these under navigation and toolbar options..

View attachment 113425

Hope this helps!
Many thanks sir.. I will apply into my first ever db..
 

oxicottin

Learning by pecking away....
Local time
Today, 03:54
Joined
Jun 26, 2007
Messages
856
Many thanks sir.. I will apply into my first ever db..

Just don't forget, in order for you to show the menu's if you want to work on the DB you have to open the DB while holding the shift button and it will open in design view.
 
  • Like
Reactions: moi

moi

Member
Local time
Today, 15:54
Joined
Jan 10, 2024
Messages
201
Just don't forget, in order for you to show the menu's if you want to work on the DB you have to open the DB while holding the shift button and it will open in design view.
Thanks for your tip..
 

Users who are viewing this thread

Top Bottom