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

x
?
Solved

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

Posted on 2009-07-09
4
Medium Priority
?
1,257 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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

886 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