Solved

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

Posted on 2009-07-09
4
1,170 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
  • 2
  • 2
4 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
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 119

Accepted Solution

by:
Rey Obrero 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

867 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

22 Experts available now in Live!

Get 1:1 Help Now