Solved

new to Access 2010 - hide ribbon using USysRibbons

Posted on 2013-05-28
21
2,284 Views
Last Modified: 2013-05-30
Hi EE,

Am trying to hide the ribbon using the USysRibbons technique discussed on EE.

a) created USysRibbons  table
b) right click on navigation pain to show system tables
c) pasted this xml into the table:

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

d) went to file/options/general/check on show add in errors

Got the following error:

s1
s2
tx for your help, sandra
0
Comment
Question by:mytfein
  • 12
  • 7
  • 2
21 Comments
 
LVL 26

Expert Comment

by:Nick67
Comment Utility
Hi Sandra,

Start here
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_28129836.html
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_27231448.html

The first one is a recently answered questioned with some samples about customizing the Ribbon
The second one is a very long discussion about how to get the UI and Ribbon to do only what you want.
Post a sample db, and some description of what you want to hide, and what you want to display.  Are you looking to remove the end-users ability to use the ribbon's buttons or are you looking to reclaim the space the Ribbon occupies?

Nick67
0
 

Author Comment

by:mytfein
Comment Utility
Hi Nick,

tx for writing...

below is the accdb,

tx, s
2013-05-24-ARG-00-MainSystem-fro.accdb
0
 

Author Comment

by:mytfein
Comment Utility
Hi Nick,

just to add, read the 2nd Q that you posted yesterday

and

http://msdn.microsoft.com/en-us/library/bb258192%28v=office.12%29.aspx#25

and trid the Ribbons table idea... and got the errors

posting the accdb again, bec unsure if the one above shows the errors

just looking to hide the ribbon when application property: deployment mode is set to deployment else, show ribbon and navigation mode bec am in test mode for me the programmer to work with

in a2003 this was done by showing/hiding the menu bar etc.

tx, s
2013-05-24-ARG-00-MainSystem-fro.accdb
0
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
Hey Nick ... that Q looks familiar :-)
0
 
LVL 26

Expert Comment

by:Nick67
Comment Utility
@mx
Go ahead and run with it.
I won't be able to muck with an accdb until later this evening.
How much ribbon tweaking have you done since we posted that/
0
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
no can do at the moment .... you've got it covered.  slammed at the moment here at work.  maybe later, sorry,
0
 
LVL 26

Expert Comment

by:Nick67
Comment Utility
Ok

d) went to file/options/general/check on show add in errors

When you turn that option on, you'll see those ugly 'error' messages.
They are NOT errors per se, they are messages that what you want -- to hide the Ribbon -- has consequences.  The system expects the Ribbon to exist.  When you turn it off, it whines.

When you go to production, you'll want that add-in option to be turned off on all client machines.  For yourself, you'll only want to leave it on for as long as it takes you to tweak the Ribbons functionality--because it will allow these expected messages -- and ones that result from genuine problems with your XML -- to be displayed.

Turn the option off.
Does the Ribbon behave the way you want?
0
 
LVL 26

Accepted Solution

by:
Nick67 earned 500 total points
Comment Utility
Ok, this one behaves the way you want to hide things in Access 2010
Note that the schema has updated.

But this globally hides the Ribbon.
Period.

If you want a different Ribbon, then you must define a UsysRibbons entry, and in autoexec code,  you must define how and when each must load.
Moreover, the global Ribbon for the app must be specified at the time the application is opened.  You can change Ribbons for forms, tables, queries and reports on the fly, but that first initial Ribbon gets set once and doesn't change.

So toggling back and forth won't work the way I think you hope it will.
Have a look at the attached sample.

Nick67
Nick.accdb
0
 

Author Comment

by:mytfein
Comment Utility
Hi Nick,

a) tx so much for replying...

   anything that you can expain the questions that follow
    would be greatly appreciated

b) tx so much for better XML to put in the USysRibbons table

i see the improved XML in the screen shot below.....


s1

c) Can you pls explain the XML?

i do not know XML,  

just for this post, i added the blank lines to ask if
sentences pair up together for ex:  <ribbon....>  and </ribbon>

d) is that "pattern"  a correct observation?

e) i understand the "scratch=true" part

f) are you making the file tab visible with the backstage command
     
       because in the second screen shot, i clicked on the file tab and it shows
            alot of info

g) can you explain this more:
         <button idMo=""FileExit"" visible=""true""/>  <tab idMso=""TabPrint"" visible=""false""/>


             what is button?
             what is idMo?
             what is idMso?



"<customUI xmlns=""http://schemas.microsoft.com/office/2009/07/customui"" >

<ribbon startFromScratch=""true"">
</ribbon>

<backstage>
  <button idMo=""FileExit"" visible=""true""/>  <tab idMso=""TabPrint"" visible=""false""/>
</backstage>

</customUI>"


s2

h) curious why an Acrobat tab shows ( this pc has Adobe Professional installed)

i) i see that it's checked off to show add in errors, yet when i clicked on the
   accdb, the error msgs == did not == show

   am guessing, bec. you provided the correct XML and i copied from the internet
    XML from a2007 website.


s3

j) what do you mean "note that the schema has updated"?

k) was hoping for the accdb inprod mode to open like this screen shot

      (this is a screen shot of a2003 mdb opened under a2010
           i clicked the "up arrow"  to hide the ribbon)

s3
     and i think with your help i'm getting what i was hoping for

      because i opened the form and hit alt+p
             then exitted the accdb
                    opened the accdb and this is what shows:

s5  

and that looks nice

l) now i press alt+ t to "unlock" the accdb, so i as a developer can work on it
and i exit the accdb, click on it again

s6
m) **  so i humbly think that the ribbon that i need for development is gone bec of
      the custom ribbon in UsysRibbons, and how to go back to default ribbons **

tx for any help you can give, esp (m)....

tx, s
2013-05-29d-ribbon.bmp
0
 

Author Comment

by:mytfein
Comment Utility
oops, thsi is the screen shot for the a2003 mdb opened using a2010 where i manually clicked
the arrow to hide the ribbon  (and the form's logic know it's in prod mode, so it hides
the file menu bar under a2003....and that logic is working under 2010)


s1
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:mytfein
Comment Utility
Hi Nick,

what do you mean by global ribbon below,   is that the ribbon that Access "comes with"

or do you mean the name of the ribbon that is specified under File/options/current database, that what ever ribbon name is mentioned there becomes the global ribbon
for the accdb.

Moreover, the global Ribbon for the app must be specified at the time the application is opened.  You can change Ribbons for forms, tables, queries and reports on the fly, but that first initial Ribbon gets set once and doesn't change.


tx, s
0
 

Author Comment

by:mytfein
Comment Utility
Hi Nick,

i just copied your Nick.accdb,   and erase the HideTheRibbon ribbon
     and opened the accdb and the default ribbon shows.

Is there vba that blanks out this ribbon sitting under File/OPtions/Currentdatabase?

tx, s
0
 
LVL 26

Assisted Solution

by:Nick67
Nick67 earned 500 total points
Comment Utility
To override any customization in Start Up, you hold down the SHIFT button as you open the app.

Be VERY CAREFUL that you do not turn the option that permits that SHIFT override off in the development copy of your application--or YOU will also be locked out.

The global ribbon is the one specified in Options|Current Database.  It is presently your HideRibbons entry in USysRibbons.  Whatever option you specify there cannot be changed after the app opens. By global, I mean the default Ribbon that will show in your app anytime you don't have code working to specifically display a different Ribbon.  If you don't specify a Ribbon in Options|Current Database, it is the one that MS creates.

Play with the final sample from the first link I posted.
It has more entries in the USysRibbons XML,

You can get a good feel for what the logic is behind that XML by looking at it
Basically, each entry in USysRibbons is a Ribbon and BackStage

<customUI xmlns=""http://schemas.microsoft.com/office/2009/07/customui"" >
    'I am creating an Access 2010 customization
        <ribbon>
            'Here's what the Ribbon will display
        </ribbon>

        <backstage>
            'Here's what backstage will display
        </backstage>
</customui>

Opening and closing tags, just like HTML
In each Ribbon, you can have tabs
<tab></tab>
in each tab you can have buttons
<button></button>

It's a very large subject!
0
 

Author Comment

by:mytfein
Comment Utility
Hi Nick,

tx so much.... you helped alot....

getting ready to leave for the day...

tomm will review the links that you posted

i may post a new question with related questions tomm....

tx so much again, s
0
 
LVL 26

Expert Comment

by:Nick67
Comment Utility
what do you mean "note that the schema has updated"?

You'll see that in the <customui> tag that the text has changed
<CustomUI xmlns="http://schemas.microsoft.com/office/2006/01/CustomUI">

is now

"<customUI xmlns=""http://schemas.microsoft.com/office/2009/07/customui"" >

MS had updated the way the Ribbon looked between A2007 and A2010.  The schema specifies what base you want to start from.
<ribbon startFromScratch="true"/> tells it that you don't want ANYTHING MS thinks needs to be on the Ribbon, that you'll do it all yourself.

When you DON'T put on all the things MS thinks are minimally required is when those 'error' messages would pop up if the show errors from add-ins box was checked.

Thanks,

Nick67
0
 

Author Comment

by:mytfein
Comment Utility
Hi Nick,

tx for the explanation,

does that mean that when there is a new release of Office

      the ribbon/schema logic will change just like you pointed out that between 2007
 
           and 2010, bec. i imagine that Microsoft will keep upgrading Office

                  if yes, will developers have to modify their apps for the new XML code?

pls advise, tx, s
0
 

Author Comment

by:mytfein
Comment Utility
Hi Nick,

i found this article that elaborates on your explanation of schema and XML
for ribbons.... so am spending some time studying this web page....

http://www.ribbon01.com/tutoriais/tuto6eng.asp?id=1#inicio


tx, s
0
 
LVL 26

Expert Comment

by:Nick67
Comment Utility
< will developers have to modify their apps for the new XML code?>
If you want to keep a consistent look and feel with the visual changes in Office then changing the schema (the 2013 one is not yet published, though) will be required.

Other than that, no
0
 

Author Comment

by:mytfein
Comment Utility
tx Nick,  s
0
 

Author Comment

by:mytfein
Comment Utility
Hi Everybody,

if you have time, posted a related question here:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_28143468.html

tx, sandra
0
 

Author Comment

by:mytfein
Comment Utility
Hi Everybody,

here is another related post, if you have time

tx, sandra

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_28143476.html
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now