OnClick Action for Ribbon tabs

  • Thread starter Thread starter Michael Cochran
  • Start date Start date
M

Michael Cochran

Everyone,

Is there a "HandleOnAction" type of event available for the fluent ribbon
tabs? For example, I've created a custom tab called "Test Method". When I
click the "Test Method" tab, I'd like a form to automatically load.

Thanks,

MikeCJ
 
Hi Mike,
This is how I do it.
In the table USysRibbons, there is xml for a group and button for Projects

<group id="grpJob" label="Projects">
<button id="btnProject" label="Projects"
size="large"
getImage="GetImages"
tag="Job.png"
onAction="OnActionButton"
supertip=" "
/>
</group>

You can see that I use onAction="OnActionButton"
There is a public sub that calls this
Public Sub OnActionButton(control As IRibbonControl)

In a public module I have this code-->

Public gRibbon1 As IRibbonUI 'Main ribbon

Public Sub onRibbonLoad1(ribbon As IRibbonUI)
' This is the customUI onLoad event handler for main ribbon
' Cache a copy of the Ribbon so we can refresh later at any time

Set gRibbon1 = ribbon

End Sub



Public Sub OnActionButton(control As IRibbonControl)
'Callbackname in XML File "onAction"

Select Case control.ID
Case "btnProject"
Call OpenProject

Case "btnCustomerGROUP"
Call OpenCustomerGROUP

Case "btnCustomerINDIV"
Call OpenCustomerINDIV

Case "btnTask"
Call OpenTask

End select
End Sub


Public Sub OpenProject
DoCmd.OpenForm "frmProjectSearch"
End Sub




Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
Back
Top