Solved

Access: How to call VBA methods from custom ribbon?

Posted on 2016-08-13
2
34 Views
Last Modified: 2016-08-13
I'm having trouble getting a custom ribbon to call methods in a module. The sample code is like this:
Option Compare Database
Option Explicit

Public globalRibbon As IRibbonUI

'Get a global reference to the ribbon object when the ribbon loads
Public Sub onRibbonLoad(ByVal ribbon As IRibbonUI)
    Set globalRibbon = ribbon
End Sub

'Open the form that is specified in the ribbon control's tag property
Public Sub ribOpenForm(control As IRibbonControl)
    DoCmd.OpenForm (control.Tag)
End Sub

Open in new window


but I can't get it to compile as neither IRibbonControl or IRibbonUI seem to be included in the Access 2016 object library. Has this changed, or do I manually need to add some reference? The compiler error is "User-defined type not specified" (for both)
TIA
Dennis
0
Comment
Question by:Dennis_Gundersen
2 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 41755083
You need a reference to the Microsoft Office 16.0 Object Library.

Jim.
0
 

Author Comment

by:Dennis_Gundersen
ID: 41755086
Yes, thanks, I just found that. I didn't notice the difference to Microsoft Access 16.0 Object Library.  Guess it's time to call it a night ;-)
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now