Minimize ribbon on app open, restore on close?

S

sandal

Just starting to get exposure to Access 2007, which I've been avoiding
since the MS dev blog made it apparent that MS was dedicated to ruining
the software for my purposes. However of course I do have to deal with
clients 'upgrading' to Office 2007.

Basic issue: Apparently the ribbon nightmare cannot be fully hidden.
However it may be minimized. I would like my app to minimize the ribbon
automatically on open via autoexec macro or code, and restore when a
particular form is closed (ie app is closed). Can anyone tell me how to
accomplish this? I don't see anything that deals with the ribbon in the
docmd list or in docmd.runcommand. There is surprisingly little on the
subject here in the newsgroup.
 
S

sandal

Just starting to get exposure to Access 2007, which I've been avoiding
since the MS dev blog made it apparent that MS was dedicated to ruining
the software for my purposes. However of course I do have to deal with
clients 'upgrading' to Office 2007.

Basic issue: Apparently the ribbon nightmare cannot be fully hidden.
However it may be minimized. I would like my app to minimize the ribbon
automatically on open via autoexec macro or code, and restore when a
particular form is closed (ie app is closed). Can anyone tell me how to
accomplish this? I don't see anything that deals with the ribbon in the
docmd list or in docmd.runcommand. There is surprisingly little on the
subject here in the newsgroup.
Ctrl-F1 via sendkeys? Is that what we are reduced to?
 
M

Maurice

Well, the keystroke to minimize the ribbon is ctrl+f1 so you could do
someting with that. Otherwise I'd suggest looking at www.accessribbon.com
I must say I lke the ribbon, takes some getting used to but when you got the
hang of it...

hth
 
A

Albert D. Kallal

While in code, go help, and type in Ribbon.

In the list of hits, one is an example on how to hide the ribbon.

The help simply suggests to make a blank ribbon, and set that in your
start-up.

So,

<CustomUI xmlns="http://schemas.microsoft.com/office/2006/01/CustomUI">
<Ribbon startFromScratch="true"/></CustomUI>

If you make the above ribbon your start-up...the ribbon will be hidden on
start-up....

The above assumes you made a usysribbons table.

So, in the "help" list (that results in ribbon), you might also want to read

How to: Apply a Custom Ribbon When Starting Access
 
S

sandal

Thanks Albert that is helpful.

I will read on a bit there but if it's simple to describe this is what I
need:

For 90% of the time it'd be ok to expose the Access 2003 created 'add
in' toolbar/ribbon and nothing else. But when a report opens I'd like to
either switch to the built in Access ribbon or the toolbar I created for
reports in Access 2003. For some reason the 'close' command on the A2003
toolbar/ribbon does not work.

Prev, code I had written switched in either one or another toolbar
depending on whether forms or a report had the focus.

If the hide ribbon thing really gets rid of all ribbons that does
possibly open up new options. I could write substitute controls for form
navigation. But reports? Ideally it'd be good to have an easy way for
users to close the report and to zoom.
 
S

sandal

So I followed the simple instructions in the help file for
HideTheRibbon, created the table, added the record. That ribbon is
selected to be the ribbon that shows when the db starts. The db has been
restarted a couple of times. The regular inane ribbons are still
appearing as usual.

I have been working with Access for ten years. I do not think I will be
able to do new work with the new Access. It's rather worse than I
expected and I had the most dismal expectations.
 
A

Albert D. Kallal

Prev, code I had written switched in either one or another toolbar
depending on whether forms or a report had the focus.

Ouch!!!

I have applications with 160 forms, and the suggestion to manually code what
form will display what menubar (or now what ribbon) is going to be a
complete
night mare. The problem here is what are you going to do when the focus
switches between 5 open forms? Your suggesting for every new form that you
add to the application, you going to have to setup code to capture the
focus change, and then have code run that displays a particular menu bar?

That is a difficult approach.

And, what would (will) happen when you launch reports? Are you now to
capture the
focus change between 5 open reports, and 5 open forms? As you can see, this
gets
difficult real fast.

Focus changes of forms, or your reports SHOULD NOT take
code. I built my ms-access applications with menubars for 10+ years now.

I NEVER written code to switch the menu bar displayed.

All you do is simply specify what
menubar to display in the "other" tab of the forms property sheet.

If you done this right, then you not need code to change/display what
menubar shows.

The same approaches works in a2007. Simply specify what ribbon to display in
he other tab.

When
you switch between 5 open forms and 5 open reports, you not have to write
one line of
code......

Another helpful tip is to build a custom menu for your reports. for those
10+ years, I re-used the same menubar for all reports. I built one with a
email button and few other features that I liked.
I Simply specify that menubar for every report. I can't even remember
building the menubar..it been that long ago!!

So, it rather simple
process that when you build a new report, you simply set the menu bar in the
"other" tab of the properties sheet (or now, you simply set the ribbon).
When you switch between forms and a report..the correct menu bar (or ribbon)
will display for you (get access to do all the dirty work here. I never did
try coding what menu bar should show..it just seems to complex to attempt
that).

So, a2007, you can do *exactly* the same thing. You not have to write ONE
line of
code to switch, or tell ms-access what ribbon to display. I never did
before..and don't now.

For reports, just build a custom ribbon, and use that for all reports. Here
one that took less time to build then to type this response:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"<ribbon startFromScratch="true">
<tabs>
<tab id = "MyReprots" label="Reports">

<group idMso="GroupPageLayoutAccess" />

</tab>
</tabs>
</ribbon>
</customUI>

I saved the above as "MyReprots" in the usysRibbon table.

I suppose we should add the "view"..print..and few out ribbon groups to the
above. (you do know how to quickly and easily lookup the idMso
above..right?).

Now, in the reports "other" tab of the property sheet, just specify the
above. When you launch a report, it will display the standard page layout.

So, try the above approach, it works well.

As for your other post, I don't know why the sample instructions in the help
file don't work for hiding the ribbon. I just tried it..and it worked fine
for me...
 
S

sandal

Hi Albert

I'm sure your approach is fine but what I've arrived at is quite
efficient too.

The apps have two global functions HandleFormToolbars() and
HandleReportToolbars(). Each form/report has a call like

HandleFormToolbars Me.Form

in it's OnActivate. The functions do a couple things. One, if they see
that the app is deployed on site, they switch off the built in toolbars.
If on a dev workstation, default toolbars are enabled. Two,
HandleFormToolbars turns off the report toolbar I've built;
HandleReportToolbars turns off form toolbars (usualy there is only one
as I don't use toolbars for much more than top level nav).

Since most forms I create begin life as a clone of an existing form, or
prototype of a form, I don't even have to add the appropriate function
calls in OnActivate(). The forms and reports have Toolbar property
settings like appMain and appReport. It's all very straightforward and
typically requires zero intervention on a per form/report basis.

Likely, the reason the ribbon code does not work for me are the vba
toolbar calls inside these two functions, I'll figure it out.

Thanks Albert you're always a great resource.
 
S

sandal

It does not work for me period. I created a new accdb from scratch,
added the USysRibbons table and the record, set it as the default
ribbon, and the regular ribbon still loads. I set the test db's single
form to use the new ribbon (it shows in the list) and still the regular
ribbon.

So the software is junk, far worse than I expected.

Can anyone tell me how I could at least rearrange the order of the tabs
which present the ribbons? I have the built in one and the add ins one
that contains my custom ribbons from A2003. If the add in ribbon was
always presented first it might pass muster.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top