Solved

Access 2007 user-defined type not defined for user-interface code

Posted on 2009-07-09
4
1,223 Views
Last Modified: 2013-11-27
I downloaded some code demonstrating how to create custom menus and menu buttons for Access 2007. I'm receiving the user-defined error message. Checking solutions, most talk about a broken reference to DAO. I tried to reference DAO 3.6 but it said there was a conflict. See the code below.

It breaks on "Public objRibbon As IRibbonUI"
'declaration
Public objRibbon As IRibbonUI
 
Public Sub OnRibbonLoad(objRib As IRibbonUI)
 
Set objRibbon = objRib
 
End Sub
 
'our callback for the SampleButton
Public Sub OnButtonPress(ctl As IRibbonControl)
 
If (ctl.ID = "SampleButton") Then
 
MsgBox ("You have just executed the OnButtonPress callback when clicking" _
& vbCrLf & "the Ribbon SampleButton!")
 
End If
 
End Sub

Open in new window

0
Comment
Question by:rdperkins
[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
  • 2
4 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 24815933
where did you place
Public objRibbon As IRibbonUI ?

it should be placed in a Regular Module not in the Form's module
0
 

Author Comment

by:rdperkins
ID: 24815975
It is in a regular module, named modTestRibbon, and shows up with all the other modules in the navigation pane under modules. The code shown is the only code in the module.
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 24818537
add to your references Microsoft Office 12 object Library
0
 

Author Closing Comment

by:rdperkins
ID: 31601718
I tried this before your answer, and it worked, but your suggestion was spot on. Thanks.
0

Featured Post

Independent Software Vendors: 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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
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…
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: …

623 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