Access 2007 ribbon help

Z

Zanetti

I create ribbon but i cant make him to work( if i press some button on ribbon
to open some form or report)

Here is a code.

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="true">
<tabs>
<tab id="MyTab" label="Kalkulacije">
<group id="Kalkulacije" label="Kalkulacije">
<button id="NovaKalkulacija" imageMso="DatasheetView"
size="normal" onAction = "ButtonCallback" label="Nova Kalkulacija" />
<button id="StampajKalkulaciju" imageMso="FilePrint"
size="normal" label="Å tampaj Kalkulaciju" onAction = "ButtonCallback"/>
<button id="pREGLEDkALKULACIJE" imageMso="FilePrint" size="normal"
label="Pregledaj Kalkulaciju" onAction = "ButtonCallback"/>
<button id="pRkALKULACIJE" imageMso="FilePrint" size="normal" label="Pregle
Kalkulaciju" onAction = "ButtonCallback"/>
</group>
<group id="TK" label="TrgovaÄka knjiga">
<button id="OtvoriTK" imageMso="FileOpen" size="large"
label="Otvori TrgovaÄku knjigu" onAction = "ButtonCallback"/>
<button id="StampajTK" imageMso="FilePrint" size="large"
label="Å tampaj TrgovaÄku knjigu" onAction = "ButtonCallback"/>

</group>
</tab>
</tabs>
</ribbon>
</customUI>



i make code for Button Call back but i don't know where can i put him

here is code

Sub ButtonCallback(control As IRibbonControl)
Select Case control.ID
Case "OtvoriTK"
DoCmd.OpenForm "Tgovacka_knjiga"
Case "NovaKalkulacija"
MsgBox "TRT"
End Select
End Sub

Other problem is how can i put my own pictures into button instead access
pictures.
And how can i write help to show when mouse cursor is on the button.

TNX
 
K

Kevin Evers

I have built a ribbon using ribbonCreator.

The xml is in the USysRibbons table and the ribbon callbacks are in a basRibbonCallbacks module.

If I click on a button (for example a toggle button), I can open a form or run some other basic code.

However, I cannot figure out how to access the properties of the controls on the ribbon.

For example: I have 5 toggle buttons that each open different tabs on a form.

When I press the first toggle button, I would like it to open the first tab. By default the toggle button stays highlighted.

When I press the second toggle button, I would like it to open the second tab and deselect the first button.

But... I cannot accees the property to do this. I think the property is "Pressed" but I cannot get it to work.

This is what I have in the basRibbonCallbacks module:

'ToggleButton

Sub OnActionTglButton(control As IRibbonControl, _
pressed As Boolean)

' Callbackname in XML File "onAction"

' Callback fuer einen Toggle Button Klick
' Callback for a Toggle Buttons click event

Select Case control.ID


' -------------------------------------------------------------------------------------
' -------------------------------------------------------------------------------------
' Tab: Navigation

Case "tgbNavSectionDashboard"
' In Tab: tabNavigation
' In Group: grpNavSection
Form_References.MainTab.Pages.Item(0).SetFocus

Case "tgbNavSectionReferences"
' In Tab: tabNavigation
' In Group: grpNavSection
Form_References.MainTab.Pages.Item(1).SetFocus

Case "tgbNavSectionReference"
' In Tab: tabNavigation
' In Group: grpNavSection
Form_References.MainTab.Pages.Item(2).SetFocus

Case "tgbNavSectionAnalysis"
' In Tab: tabNavigation
' In Group: grpNavSection
Form_References.MainTab.Pages.Item(3).SetFocus

Case "tgbNavSectionCalculations"
' In Tab: tabNavigation
' In Group: grpNavSection
Form_References.MainTab.Pages.Item(4).SetFocus

Case "tgbNavSectionDissertationDates"
' In Tab: tabNavigation
' In Group: grpNavSection
Form_References.MainTab.Pages.Item(5).SetFocus

Case Else
MsgBox "The Value of the Toggle Button """ & control.ID & """ is: " & pressed & vbCrLf & _
"Der Wert der Toggle Button """ & control.ID & """ ist: " & pressed, _
vbInformation

End Select

End Sub


Sub GetPressedTglButton(control As IRibbonControl, _
ByRef pressed)
' Callbackname in XML File "getPressed"

' Callback fuer ein Access ToogleButton Control wie dieser Angezeigt werden soll
' Callback for an Access ToogleButton Control. Indicates how the control is displayed

Select Case control.ID

Case "tgbNavSectionDashboard"
' In Tab: tabNavigation
' In Group: grpNavSection
If getTheValue(control.Tag, "DefaultValue") = "1" Then
pressed = True
Else
pressed = False
End If
Case "tgbNavSectionReferences"
' In Tab: tabNavigation
' In Group: grpNavSection
If getTheValue(control.Tag, "DefaultValue") = "1" Then
pressed = True
Else
pressed = False
End If
Case "tgbNavSectionReference"
' In Tab: tabNavigation
' In Group: grpNavSection
If getTheValue(control.Tag, "DefaultValue") = "1" Then
pressed = True
Else
pressed = False
End If
Case "tgbNavSectionAnalysis"
' In Tab: tabNavigation
' In Group: grpNavSection
If getTheValue(control.Tag, "DefaultValue") = "1" Then
pressed = True
Else
pressed = False
End If
Case "tgbNavSectionCalculations"
' In Tab: tabNavigation
' In Group: grpNavSection
If getTheValue(control.Tag, "DefaultValue") = "1" Then
pressed = True
Else
pressed = False
End If
Case "tgbNavSectionDissertationDates"
' In Tab: tabNavigation
' In Group: grpNavSection
If getTheValue(control.Tag, "DefaultValue") = "1" Then
pressed = True
Else
pressed = False
End If

Case Else
If getTheValue(control.Tag, "DefaultValue") = "1" Then
pressed = True
Else
pressed = False
End If

End Select

End Sub

------------------------

Any help would be appreciated.

Thank you,

Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top