Problem with Command Bars

Posted on 2011-10-30
Last Modified: 2012-05-12
I have an app in which I create and use custom command bars (shortcut menus).  It works fine.

I created a new db and imported the entire app into it, for an unrelated reason.  Now, when I run the code (jpg attached), I get an error: Compile Error: User-defined type not defined.

Can anyone help?

Thanks in advance.

  Undefined type error
Question by:CRB1609
    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    In the VBA editor >> Tools>>References ... Look for any that are listed as:

    **Missing <SomeReferenceName>

    Resolve the missing Reference ...

    LVL 75

    Accepted Solution

    Possibly a Missing Reference to the Office Object Library ...


    Author Comment

    The References are identical:

    Visual Basic For Applications
    Microsoft Access 14.0 Object Library
    Microsoft Office 14.0 Access database engine Object Library
    LVL 74

    Expert Comment

    by:Jeffrey Coachman
    Are you running the original and the "Copy" on separate machines or the same machine?
    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    Can you post the code above code  so we can try it.  Is the error on the blue line of code?

    If so ... that error message is almost *always* because of a Reference issue of some kind ...


    Author Closing Comment

    Very sorry, everyone.  I did not have the Microsoft Office 14.0 Library checked on.  Duh!  I just couldn't see for looking.

    Thanks to all for the help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    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

    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    779 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

    18 Experts available now in Live!

    Get 1:1 Help Now