473,785 Members | 2,738 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CommandBars in Access 2002/2003

I'm trying to prevent any built-in command bars or menu bars from appearing
in an Access MDE.

I have the following code on the Form_Open event of the app's main form:

CommandBars("Me nu Bar").Enabled = False

This works, but if a user has been using Access with a tool bar visible
(Form/Report
Formatting, for example) prior to opening my MDE, that tool bar is still
visible when my MDE is opened - despite not having a Menu Bar.

Can I just loop through the entire collection of command bars and disable
them all?

'Required reference Office 11.0 Object Library
Dim cb As CommandBar
For Each cb In CommandBars
cb.Enabled = False
Next

There are 177 named CommandBars in this loop, however. If I go to Tools >
Customize, I see only 28 Toolbars (on the Toolbars tab of the Customize
dialog).

Which toolbars can I safely disable? The only ones I really need to hide
are the ones that may still be visible after the app's main form is
maximized and the Menu Bar is disabled (since toolbars cannot be made
visible if there is no Menu Bar and the main form is maximized). The stuff
available on right click I can deal with elsewhere.

Other suggestions?

Thanks in advance.
Nov 13 '05 #1
1 3500
By trial and error, this list seems to be exhaustive.

Whatever other toolbars there are, they cannot be made visible once this
code is run.

Private Sub Form_Open(Cance l As Integer)
Dim varCb As Variant
'On Error Resume Next
For Each varCb In Array( _
"Task Pane", "Database", "Menu Bar", "Report Design", _
"Page View", "Alignment and Sizing", "Formatting (Page)", _
"Formatting (Datasheet)", "Print Preview", "Form Design", _
"Toolbox", "Form View", "Formatting (Form" & Chr(47) & "Report)", _
"Source Code Control", "Relationsh ip", "Table Design", _
"Table Datasheet", "Query Design", "Filter/Sort", _
"Macro Design", "Utility 1", "Utility 2", "Page Design", _
"PivotTable ", "PivotChart ", "Query DataSheet", "Web", _
"Formatting (PivotTable" & Chr(47) & "PivotChart )")
CommandBars(var Cb).Enabled = False
Next
End Sub

'Private Sub Form_Open(Cance l As Integer)
' Dim cb As CommandBar
' For Each cb In CommandBars
' cb.Enabled = True
' Debug.Print cb.Name
' Next
'End Sub

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
2653
by: Noesis Strategy | last post by:
When I ordered my new laptop, Sony didn't offer Access 2003 in its bundles. Recently, I have begun to design Access databases using an copy of Access 2002 from my previous laptop. It works fine, but I would like to have all the office apps on the same version. So I have a few questions: 1) Is the file format the same as 2002? Can 2002 users read 2003 files? 2) What are the major reasons for upgrading to 2002 ?
1
5754
by: Wayne Aprato | last post by:
I have a client who is running several Access 97 databases that I have written for them. They are about to upgrade to Access 2003. Is the default file format of Access 2003 still Access 2000 the same as it was in Access 2002? I am running Access 2002 at the moment. Is there any reason for testing purposes etc, for me to purchase Access 2003 if I am going to recompile the Access 97 mdb files into Access 2000 format mde files which...
3
2502
by: Colin Chudyk | last post by:
Hi, Here is my situation. Can anyone provide insight? I have developed a database in Access 2002. I am planning to distribute it as a split MDE (front) / MDB (back) to be used by the Access runtime and also full-version. Some of the client workstations will have Access 2002 installed. Most of them will have the runtime installed. However, I can't find the Office 2002 Developer Edition anywhere! Nobody has
7
3466
by: Wayne Aprato | last post by:
I have several Access 2003 mde databases. When I try to open them in Access 2002 I get the following error: "The Visual Basic for Applications project in the database is corrupt." Interestingly I can open the mdb files of the same 2003 databases in Access 2002 without problems. To my understanding the file formats of 2002 and 2003 are the same and this problem shouldn't exist. And why is it only the mde files that are giving the...
6
4753
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much appreciated. Thanks in advance
28
2656
by: Neil Ginsberg | last post by:
I have a client who is using Access 2002/2000 (the database itself is written in 2000), and is considering migrating to Access 2003. Any recommendations on whether Access 2003 is worth the migrate, or should he stick with 2002? Thanks! Neil
47
4545
by: ship | last post by:
Hi We need some advice: We are thinking of upgrading our Access database from Access 2000 to Access 2004. How stable is MS Office 2003? (particularly Access 2003). We are just a small company and this is a big decision for us(!) It's not just the money it's committing to an new version of Access!
52
9984
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server 2005, and, since he already has licenses for Office Pro 2002, he wants to upgrade to that. I've been saying that we need to upgrade to Access 2003, not 2002, even if Office is kept at 2002. We are also looking to do a fair amount of...
3
2347
by: banba_ca | last post by:
When I create a new db from the main Access window or thru Vb (set newdb = ...) I always end up with Access 2000 file format. I would like to get 2002 - 2003 file format. The reason is that when I try to link from a 2002 - 2003 db to a 2000 db, the Jet engine complains that it can't find the table in the target (2000) database. And no, I can't convert on the fly. Any suggestoins would be appreciated. ....Banba
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10087
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.