Solved

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

Posted on 2009-07-09
4
1,149 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
Comment Utility
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
Comment Utility
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
Comment Utility
add to your references Microsoft Office 12 object Library
0
 

Author Closing Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

762 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

6 Experts available now in Live!

Get 1:1 Help Now