Solved

Access: How to call VBA methods from custom ribbon?

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

911 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

14 Experts available now in Live!

Get 1:1 Help Now