To expand on June7's post, here's a ribbon definition that I was working with about a year ago that opens a form via a callback. It creates a new tab called "EDIT" and has 2 buttons for 2 forms.
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Video 4 http://accessjitsu.com/custom-ribbon/ -->
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="OnRibbonLoad">
<ribbon startFromScratch="false">
<tabs>
<tab idMso="TabAddIns" visible="false"/>
<tab id="Edit" label="Edit">
<group id="OpenForm" label="Open Form">
<button id="MainMenu" label="Main Menu" imageMso="BlogHomePage"
tag="frmMainMenuExample" onAction="ribOpenForm" getEnabled="ControlEnabled"
size="large" supertip="Open the Main Menu"/>
<button id="FormText" label="Formatted Text" imageMso="FormatTextMore"
tag="frmFormattedTextExample" onAction="ribOpenForm" getEnabled="ControlEnabled"
size="large" supertip="Open the form for whatever"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
The callback
Code:
'---------------------------------------------------------------------------------------
' Method : ribOpenForm, callback
' Author : davegri
' Date : 03/01/24
' Purpose: Open the form that is specified in a ribbon control's tag property.
' Note that in the ribbon XML, the argument ('control' below) for the onAction
' is not explicitly named, it is simply implied by XML context to be the control's tag
'---------------------------------------------------------------------------------------
Public Sub ribOpenForm(Control As IRibbonControl)
DoCmd.OpenForm (Control.Tag)
End Sub