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

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Toolbar/Menu confusion    
 
   
StarsFan
post Jan 29 2007, 11:05 AM
Post #1

UtterAccess Guru
Posts: 753
From: Rendon, Texas



I found the code below to turn off the toolbars and menu's, which works fine, however even if I set it back to true at the Close event of the main form, I can not see the toolbars and menu's on any of my other databases (separate dbases from the one that this code is in). I can set it back to True from a command button and all toolbars and menu's will come back. I thought I read if you hold the shift key down as a bypass then it should still allow toolbars and menu's to be seen but that it not the case for me. Any suggestions or idea's?

TIA,
Shane

' Disable all Menus and Toolbars
Dim i As Integer

For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i
Go to the top of the page
 
+
vtd
post Jan 29 2007, 11:43 AM
Post #2

Retired Moderator
Posts: 19,667



Shift key only bypasses the Start-up Options. Thus, if your Access installation normally shows the CommandBars and the Start-up Options hide the CommandBars, holding the Shift key will bypass the Start-up Options, i.e. the "Hide CommandBars" start-up option will not be processed and there for the normal CommandBars will be visible.

However, in your case, it sounds like somewhere in the current database, your code hides the CommandBars (of the Access installation) and when you close this database and open Access or another database, the CommandBars are not visible until your code enables them again. This got nothing to do with the Start-up Options of the newly opened database. The Shift Bypass key still works but the CommandBars are still not visible because they are hidden by the code previously and not by the Start-up Options.

You will need to check whether the re-enabling code of the current database actually gets executed ...
Go to the top of the page
 
+
StarsFan
post Jan 29 2007, 11:59 AM
Post #3

UtterAccess Guru
Posts: 753
From: Rendon, Texas



Mr. Dinh,

You we're exactly right. I had put the code in the frmNavigators OnClose event, which wasn't firing when the dbase was closing cause on the frmNavigator I have a cmdButton that closes the dbase with DoCmd.Quit. The frmNavigator was not closing so by adding DoCmd.Close acForm,"frmNavigator" before DoCmd.Quit, all is working well now.

Thank you for lending a hand and pointing me in the right direction,
Shane
Go to the top of the page
 
+
vtd
post Jan 29 2007, 03:47 PM
Post #4

Retired Moderator
Posts: 19,667



You're welcome ... Glad it worked out for you ...
Go to the top of the page
 
+

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

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th June 2013 - 07:54 AM