Solved

Access: How to call VBA methods from custom ribbon?

Posted on 2016-08-13
2
119 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 58

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

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.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

615 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