UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> DoCmd.ShowToolbar "Ribbon", acToolbarNo, Office 2007    
 
   
RAZMaddaz
post Jun 16 2010, 08:52 AM
Post #1

UtterAccess VIP
Posts: 7,325
From: Bethesda, MD USA



I want to get the Ribbon to Minimize on this Form when open, not when working on other non-related databases. Suggestions?
Go to the top of the page
 
+
pere_de_chipstic...
post Jun 16 2010, 09:44 AM
Post #2

UtterAccess VIP
Posts: 8,629
From: South coast, England



Hi RAZMaddaz

does this link answer your question?

You would presumably need to maximize the ribbon on closing the form?

hth

This post has been edited by pere_de_chipstick: Jun 16 2010, 09:45 AM
Go to the top of the page
 
+
RAZMaddaz
post Jun 16 2010, 11:51 AM
Post #3

UtterAccess VIP
Posts: 7,325
From: Bethesda, MD USA



Thanks for your help Bernie!!!!!!!!!!

I tried a different function and this works, HOWEVER the only way I can get the below to work is if when I open the File/database and hold down my Shift key. Then when I open the Form, there is no Ribbon. Ya got me!!! (IMG:style_emoticons/default/dazed.gif)

CODE
Public Sub HideRibbon()
    On Error Resume Next
    DoCmd.ShowToolbar "Ribbon", acToolbarNo
    On Error GoTo 0
End Sub


CODE
Private Sub Form_Open(Cancel As Integer)
    Call HideRibbon
    Me.OrderBy = "StatusSortBy, ECGVolumeColor.Index"
End Sub
Go to the top of the page
 
+
RAZMaddaz
post Jun 16 2010, 12:20 PM
Post #4

UtterAccess VIP
Posts: 7,325
From: Bethesda, MD USA



The reason why I couldn't get it to work was because in the Current Database Options, I had deselected "Allow Full Menus" and "Allow Default Shortcut Menus".

Thanks for your help!!!

RAZMaddaz
Go to the top of the page
 
+
pere_de_chipstic...
post Jun 16 2010, 01:21 PM
Post #5

UtterAccess VIP
Posts: 8,629
From: South coast, England



Hi RAZMaddaz

I've tried DoCmd.ShowToolbar "Ribbon", acToolbarNo, as I wanted to open the db to a pop up log-on form with no ribbon
and as you found, it only worked if the database is opened with the shift key down and then the form opened.

I had wondered whether there was some relationship to the "Allow Full Menus" option setting, but hadn't followed it up further as I tend to clear the 'Allow Full menus' option as part of the DB start up - A hangover from developing earlier versions of Access where it helped prevent users gaining access to commands what they ought not to get access to. I might decide to set the option on start up before opening the log-on form and then clear it when the log on form closes!

Clearing the 'Allow Full menus' option has other knock on effects as well, because some built in commands then don't show when in Runtime, - you need to add visible="true" to each Ribbon XML command line effected (see this thread).

Also your original post asked for the ribbon to be minimized rather than hidden, which is why I suggested the alternative method. The ShowToolbar command hides the ribbon rather than minimizes it doesn't it?

Anyway, glad you found a solution. (IMG:style_emoticons/default/thumbup.gif)
Go to the top of the page
 
+
RAZMaddaz
post Jun 16 2010, 02:33 PM
Post #6

UtterAccess VIP
Posts: 7,325
From: Bethesda, MD USA



In one copy of my database/file, I never converted it over to 2007 and with this version "Allow Built-in Toolbars" shows, however it does not show in 2007. If this is not selected, then the code I entered before will not work.
Go to the top of the page
 
+
pere_de_chipstic...
post Jun 16 2010, 03:41 PM
Post #7

UtterAccess VIP
Posts: 8,629
From: South coast, England



Hi RAZMaddaz

Not sure if I understand you (IMG:style_emoticons/default/confused.gif)

On the example database you posted on the thread to Michael (aka PropMngr) the A2007 format db seemed to respond to the command:
DoCmd.ShowToolbar "Ribbon", acToolbarNo, whatever the settings of "Allow Full Menus" and "Allow Default Shortcut Menus", and however you allow the database to open.

On the other hand with my own A2007 database; if I open with the shift key down and then run the autoexec, the acToolbarNo command works, if I open and let the autoexec run automatically then the acToolbarNo command is ignored! and this seems again to be independant of the settings of "Allow Full Menus" and "Allow Default Shortcut Menus". I am confused ......

Go to the top of the page
 
+
RAZMaddaz
post Jun 17 2010, 08:21 AM
Post #8

UtterAccess VIP
Posts: 7,325
From: Bethesda, MD USA



Sorry Bernie for all the confusion!!!!!!

First, the file I uploaded was not the same file I was having problems with.

The File I was working with was an Access 2003 file, viewed in Access 2007 and I couldn't get the Ribbon to disappear. I then learned about how I was going to use VBA to remove the ribbon. I copied some VBA and still could not get it to disappear. I then converted the dbase to 2007 format and still could not get it to work. I then went back to the Access 2003 format version and changed the Ribbon and Toolbar Options, because I originally had all THREE unselected. I tried a few combinations, just to learn that unless I have "Allow Built-in Toolbars" clicked and the other two (Allow Full Menus and Allow Default Shortcut Menus) not clicked/selected then the VBA will not work.

Once I got this to work in Access 2003 format, I converted the file to Access 2007 and everything still works.
Go to the top of the page
 
+
pere_de_chipstic...
post Jun 18 2010, 05:09 AM
Post #9

UtterAccess VIP
Posts: 8,629
From: South coast, England



Hi Raz

The "Allow Built-in Toolbars" seems to be the critical one! I had set this to 'No' as part of the start up procedure code - from the original version in A2003. Once set to 'Yes' (and saved), the 'DoCmd.ShowToolbar "Ribbon", acToolbarNo' works as expected and the state of the other two (Allow Full Menus and Allow Default Shortcut Menus) don't seem to matter.

I don't recall seeing a 'Allow Built-in Toolbars' option in A2007 Access Options? so it seems a(nother) 'hangover' from earlier versions can have an impact on A2007 functionality (IMG:style_emoticons/default/crazy.gif)

Thanks for the update. (IMG:style_emoticons/default/thanks.gif)
Go to the top of the page
 
+
cocoflipper
post Jun 13 2011, 02:56 PM
Post #10

UtterAccess Guru
Posts: 943
From: Denver - CO



UtterAccess is a great resource! I would have been spinning my wheels for a while if I didn't see this post. "Allow Built-in Toolbars" in was set to False in my accdb (converted from A2003), and I don't think this is a menu option in A2007 Access Options that I can edit (set it to True), is it? Anyway, great to have a community who has "been there, done that".
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Search  ·  Go to Top  ·  Lo-Fi Version Time is now: 23rd April 2014 - 11:56 AM