Turning Off Toolbars

  • Thread starter Thread starter Christopher Caswell
  • Start date Start date
C

Christopher Caswell

It has been my observation that whenever a user opens my application, MS
Access provides either 1) the default toolbars or 2) the toolbars in the
header which were last used by them. This observation could be wrong, but
ultimately I'm seeing a variation to which toolbars appear based on the
workstation.

My application form uses the majority of the MS Access workspace, so that if
extra toolbars are turned on, the application goes slightly out of view (at
the edges) and scroll bars are turned on.

I'd like my application to determine what toolbars are open and to close
them. How can this be achieved?

Thanks,

Chris
 
Christopher said:
It has been my observation that whenever a user opens my application, MS
Access provides either 1) the default toolbars or 2) the toolbars in the
header which were last used by them. This observation could be wrong, but
ultimately I'm seeing a variation to which toolbars appear based on the
workstation.

My application form uses the majority of the MS Access workspace, so that if
extra toolbars are turned on, the application goes slightly out of view (at
the edges) and scroll bars are turned on.

I'd like my application to determine what toolbars are open and to close
them. How can this be achieved?

Don't think you need to determine which ones are "open",
just disable all of them:

Dim bar As CommandBar
For Each bar In Application.CommandBars
bar.Enabled = False
Next
 
Marshall said:
Don't think you need to determine which ones are "open",
just disable all of them:

Dim bar As CommandBar
For Each bar In Application.CommandBars
bar.Enabled = False
Next


Please keep the correspondence in the newsgroups so everyone
can benefit from the exchange of ideas.

In response to your private email:
Question--I'm getting "User-defined type not defined" when I run this.
What reference do I need?

The CommandBars collection is defined in the Office library.

I never know what to do with these...what's
the routine for figuring this out?

This one is explained in Help (A2002). For other objects, I
guess that if you think you need to use an object, you must
of heard of the library it's part of ;-\

I hate adding another reference even when I feel that I
can't live without it. In this case, you can hide a
tool/menu bar without referring to the command bar object by
using just the toolbar's name:

DoCmd.ShowToolbar "Menu Bar", acToolbarNo
 
Back
Top