Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access: How to call VBA methods from custom ribbon?

Posted on 2016-08-13
2
Medium Priority
?
177 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 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

926 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