Table of Contents

In this post I will be showing you how to create Splitbuttons.

Featured Videos:

  • 06 – Split Buttons

Featured Downloads

  • AccessRibbon06

06 – Split Buttons

The Code

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

      < tab id="tabHome" label="Home" visible="true">     

         < group id="GroupHome"  label="Home"> 
        < button id="cmdHome" label="Home" imageMso="BlogHomePage"
                size="large"   onAction="onClick"/>          
       < /group> 

        < group id="GroupNavigation"  label="Navigation"> 

        < splitButton id="sbStudents" size="large"> 
                < button id="cmdStudents"  imageMso="AddOrRemoveAttendees"
                  label="Students"  onAction="onClick"/> 
                         < menu id="menStudents"> 
            < button id="cmdStudentsNew" label="New Student" onAction="onClick"   imageMso="DiagramShapeInsertClassic" /> 
              < button id="cmdStudentsEdit" label="Edit Student" onAction="onClick"   imageMso="DataFormSource" /> 
               < button id="cmdStudentsReports" label="Reports" onAction="onClick"   imageMso="DefinedPrintStyle"/> 
                          < /menu> 
             < /splitButton> 

   < /group> 

      < /tab> 
    < /tabs> 
  < /ribbon> 
< /customUI>
Public Sub OnClick(control As IRibbonControl)
Select Case control.id

    '---------------------------------------------------
    '---------------------------------------------------
    '----------------Home---------------------------

    Case "cmdHome"
        CloseAllFormsAndReports
        OpenSingleform "frmHome", Edit, Normal

    '---------------------------------------------------
    '---------------------------------------------------
    '----------------Students---------------------------

    Case "cmdStudents"
        OpenSingleform "frmStudentsNav", Edit, Normal
    Case "cmdStudentsNew"
        DoCmd.OpenForm "frmStudentsDataEntry", , , , acFormAdd, acDialog
    Case "cmdStudentsEdit"
        OpenSingleform "frmStudentContinuous", Edit, Normal
    Case "cmdStudentsReports"
        OpenSingleform "frmStudentReports", Edit, Normal
End Select

End sub

Related Posts

01 – Introduction to the Ribbon
02 – Explanation of the Code
03 – The USysRibbons Table
04 – Tabs, Groups, Buttons and ImageMSOs
05 – Callbacks
07 – Get Label
08 – Drop Down Menus 1
09 – Drop Down Boxes 2
10 – Splitting a Database

One comment

  1. Copying the cody really seems to be causing me issues. Is there something I can do or watch for to make sure the code is correct?

Leave a Reply to Phillip GarrettCancel Reply

Your email address will not be published. Required fields are marked *

Visit Us On TwitterVisit Us On FacebookVisit Us On Youtube