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"
Public objRibbon As IRibbonUI
Public Sub OnRibbonLoad(objRib As IRibbonUI)
Set objRibbon = objRib
'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!")