Solved

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

Posted on 2009-07-09
4
1,191 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 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

860 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