Combobox in Custom Ribbon (1 Viewer)

Drand

Registered User.
Local time
Tomorrow, 00:16
Joined
Jun 8, 2019
Messages
51
Hi

I have a custom ribbon on which I am trying to place a combobox to enable selection of various reports.

To date I have managed to create the appropriate combobox using the following code:
<tab id="Reports" label="Reports">
<group id="Group23" label="Reports">
<comboBox id="MyCombo"
label="Report Type"
sizeString="AAAAAAAAAAAAAAAAAA"
onChange="ComboBox_OnChange">
<item id="Sales" label="Sales" />
<item id="Separator" label="__________________" />
<item id="Financial" label="Financial" />
<item id="Test" label="Test" />
</comboBox>
</group>
</tab>

I am unable to find how to "trigger an event" when an item in the combobox is selected, like say in the onAction commasnd for a button on the ribbon.

I would like to open a different report based on the item selected in the combobox.

Would really appreciate some assistance with this.

Many thanks

David
 

Drand

Registered User.
Local time
Tomorrow, 00:16
Joined
Jun 8, 2019
Messages
51
Thanks for this. I will have a look when I get a chance tomorrow. Appreciate your help.
 

Drand

Registered User.
Local time
Tomorrow, 00:16
Joined
Jun 8, 2019
Messages
51
Hi again

I have made some progress with this but a couple of issues.

I have modified your code in uSysRibbons to include all the other items I currently have on my custom ribbon and to delete those that show in your example which I don't need. All good and works perfectly in your sample db.

I then exported uSysRibbons and MRibboncallback to my db and ran into a few issues.

What is the significance of "Public gobjRibbon As IRibbonUI" ? When I compile my db I get an error "User-Defined error. User Type not Defined".

Would appreciate your feedback and sorry to keep troubling you.

Many thanks

David
 

arnelgp

error reading drive A:
Local time
Today, 22:16
Joined
May 7, 2009
Messages
9,925
on VBA , Tools->Reference

add reference to Microsoft Office X.XX Object Library. (X.XX means the version of office you have).

''''
Public gobjRibbon As IRibbonUI
means that your Ribbon is now in Public variable.
you can Refresh it (gobjRibbon.Invalidate).
 

Drand

Registered User.
Local time
Tomorrow, 00:16
Joined
Jun 8, 2019
Messages
51
Hi again

Sorry for the slow response. I only just the chance to get back to this! All is working perfectly now and this has proved to be really useful in my application.

When you say that "you can Refresh it (gobjRibbon.Invalidate)." does this reset the comobox to it's original state and if so, how do I run this and when?

Once again, many thanks, I really appreciate the help you give me.

David
 

arnelgp

error reading drive A:
Local time
Today, 22:16
Joined
May 7, 2009
Messages
9,925
if you are using a Variable, say Enable/disabling the control on ribbon,
you all .Invalidate to Refresh the ribbon and set Enable/disable a control.

you can further google about Ribbon.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom