Results 1 to 3 of 3
  1. #1
    zambam737 is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2009
    Posts
    6

    Create a brand new Ribbon

    Dear all

    before the 'have you searched' police jump on me - yes.. I have spent time searching this and other sites forums for my answer. If it is in here I appologise..

    I have a an application, its ready to go live but I want to give it its own Ribbon. Basically because i wish to prevent users seeing all the options. It need only have a print preview and print option actually. I will hide the ribbon in the start up options so it isnt available on my main form, but need a way of assigning a print option on my reports and some datasheet forms.

    I know how to hide or assign a ribbon, in the options etc.. but having read articles on here and Google, I dont get how to actually create the ribbon in the first place. I know I have to create a module and call the UI etc as described in one thread.. but not being a pro developer, can someone please send me a step by step list - with examples...?

    I normally get my answers from looking at the sample Dbs that come with Access, and copy the code / module etc, but I couldnt find one.



    The last time I did this was back in the day when you used macros to create a mnuFile and assigned then to forms and reports. The ribbon philosophy seems inflexible and tedious.. I must be missing something!

    An example I could copy would be very much appreciated..

    Thanks in advance

    zb

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    take a look at the 3rd and 5th results here: http://www.google.com/#sclient=psy&h...3fa2fab1e0dd34

    I don't know the answer, but obviously the workaround here would be buttons on these objects with VBA code behind them that do what you want. You can always go that route.

  3. #3
    eki einstein's Avatar
    eki einstein is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2013
    Location
    Bekasi - Jawa Barat- Indonesia
    Posts
    26
    this some example !
    First First Open Database ms acces 2010 that will be created Ribbon menu

    Right click on the All Access Object, Select Navigation Option
    Click image for larger version. 

Name:	1.jpg 
Views:	8 
Size:	71.2 KB 
ID:	10881
    do like this ! pay attention to the red circle
    Click image for larger version. 

Name:	2.jpg 
Views:	8 
Size:	110.3 KB 
ID:	10882
    if you do like i told u ! then your database will show the hiden object ! i do not need to tell you why just doit okay !! it need lot of explenation why we doing this !
    Click image for larger version. 

Name:	3.jpg 
Views:	7 
Size:	90.0 KB 
ID:	10883
    create a table name it USysRibbons ! "USysRibbons ", the content is: ID (AutoNumber, Long Integrer,Primary key), RibbonName (Text, 255), RibbonXML (Memo).
    Click image for larger version. 

Name:	4.jpg 
Views:	8 
Size:	63.7 KB 
ID:	10884
    the table will look like this !
    Click image for larger version. 

Name:	5.jpg 
Views:	8 
Size:	81.8 KB 
ID:	10885
    RibbonName = "what ever u wish to call the ribbon"
    RibbonXML="the XML code for the ribbon"
    You must first under standing that ribbon in ms acces 2007 and ms acces 2010 build by xml code !, its just like html <></> something like that !, you can put a name for your ribbon in RibbonName, and put the xml code in RibonXML then call them later in your app !

    heres basic ribbon xml code, for creating new ribbon in ms aces 2010
    ------------------------------------------------------------------------------------
    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <ribbon startFromScratch="true">
    <tabs>
    <!—Put the custom xml code here -->
    </tabs>
    </ribbon>
    </customUI>
    -------------------------------------------------------------------------------------

    you need to know theres a basic Grouping that ms acces using in their code, it call "TAB" and "Group"
    sample code if you want to create a Tab

    ------------------------------------------------------------------------------------------
    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <ribbon startFromScratch="true">
    <tabs>
    <tab id="MyTab" label="Name of TAB">
    </tab>

    </tabs>
    </ribbon>
    </customUI>
    --------------------------------------------------------------------------------------------
    if you want to make two custom tab then :
    --------------------------------------------------------------------------------------------
    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <ribbon startFromScratch="true">
    <tabs>
    <tab id="MyTab" label="Name TAB">
    </tab>
    <tab id="MyTab2" label="Name TAB 2">
    </tab>

    </tabs>
    </ribbon>
    </customUI>
    -----------------------------------------------------------------------------------------------
    you can change the name tab to what ever name what you want to call your tab !, if you want to make 3 tab then :
    --------------------------------------------------------------------------------------------------------------------
    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <ribbon startFromScratch="true">
    <tabs>
    <tab id="MyTab" label="Name TAB">
    </tab>
    <tab id="MyTab2" label="Name TAB 2">
    </tab>
    <tab id="MyTab3" label="Name TAB 3">
    </tab>

    </tabs>
    </ribbon>
    </customUI>
    -------------------------------------------------------------------------------------------
    now creating group in a tab:
    -------------------------------------------------------------------------------------------
    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <ribbon startFromScratch="true">
    <tabs>
    <tab id="MyTab" label="Name TAB">
    <group id="MyGroup" label="Grup1">
    </group>

    </tab>
    <tab id="MyTab2" label="Name TAB 2">
    </tab>
    <tab id="MyTab3" label="Name TAB 3">
    </tab>

    </tabs>
    </ribbon>
    </customUI>
    ----------------------------------------------------------------------------------------------
    then you can put the menu in that group just using the xml code for creating menu like this :
    -----------------------------------------------------------------------------------------------
    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <ribbon startFromScratch="true">
    <tabs>
    <tab id="MyTab" label="Name TAB">
    <group id="MyGroup" label="Grup1">
    <control idMso="Copy" label="Copy" enabled="true"/>
    </group>
    </tab>
    <tab id="MyTab2" label="Name TAB 2">
    </tab>
    <tab id="MyTab3" label="Name TAB 3">
    </tab>

    </tabs>
    </ribbon>
    </customUI>
    ---------------------------------------------------------------------------------------------------
    put the xml code in the RibbonXML, then call your ribbon from File>Option>Current database>Ribbon and toolbar option, ribbon name, your ribbon name will show there, you can pick from the drop down list, click OK the Re open the database " your ribbon is ready !

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Ribbon vs menubar
    By Mrchang in forum Access
    Replies: 1
    Last Post: 12-11-2011, 09:42 AM
  2. Hiding The Ribbon
    By rashidhussain in forum Forms
    Replies: 1
    Last Post: 03-01-2011, 03:36 AM
  3. Brand new - Help with my tables!
    By Yeti in forum Access
    Replies: 5
    Last Post: 09-15-2010, 07:52 AM
  4. Ribbon question
    By ksmith in forum Access
    Replies: 2
    Last Post: 07-13-2010, 10:27 AM
  5. Ribbon?
    By stephenaa5 in forum Reports
    Replies: 2
    Last Post: 06-29-2010, 11:22 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums