Solved

Access: How to call VBA methods from custom ribbon?

Posted on 2016-08-13
2
58 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

832 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