Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672

    Access Menus'

    Just started a new job as the sole IT person, we are running Access 2013 and have 2 databases that at the top have


    File - Home - Create - External Data - Database Tools - Add-INS

    Now if I go to File - Options - Addins there are no addins listed

    Question at hand here is how do I get to the code behind the "Addins" menu that is being displayed?
    (It is multiple drop down lists, that some will open a form and others run queries)

    If it makes a difference under the "Add-Ins" toolbar it reads Custom Toolbar, so is this a custom toolbar that was created?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    what are you wanting to do?
    add what add-in?
    YOUR addin, or a 3rd party?

  3. #3
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    Quote Originally Posted by ranman256 View Post
    what are you wanting to do?
    add what add-in?
    YOUR addin, or a 3rd party?
    I am needing to modify what appears to be a custom Add-In that was developed internally, but I am not sure how to add to it...

    It appears to essentially be a "ribbon" titled Add-ins that has drop down menu's that will either
    1) Run A Query
    2) Luanch a form

  4. #4
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    Is the ribbon hidden in favor of this menu bar? These look like the old menu bars from before the ribbon days?
    If so, they were likely created in version 2003 or earlier and there may or may not be any code behind them. Open the vb editor and do a search (option - project) for the word 'commandbar'. If you find code related to the commandbar object, that's a good start. To remove (or better, hide) a menu or one of its options will require code changes. If you find no such code, it might be possible to hide or alter the menu bar or options, but we'd need to know how the menu bar interacts with the Access ribbon.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    @Micron - the text 'commandbar' is not found. The ribbon is also displayed. See an image https://www.dropbox.com/sh/ien19k98d...LQ-sdjxha?dl=0

  6. #6
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    As long as you're certain about the search (i.e. you searched the whole project and there was no space after commandbar) then I'm not sure what you're looking at. Since I'm stuck in v 2007, I'll say it looks like a custom menu from pre 2007, but with a more modern style, that is loaded along with the ribbon. If that's true, there may be no code behind it and my position is that you will have to discover it's name in order to affect it. Obviously this would be easier if you could get your hands on a 2003 version.

    I found this code (which I only glossed over) that you might be able to use to find commandbar names in your project.
    http://www.devhut.net/2011/06/22/vba...-command-bars/
    Be careful that you don't delete your menu, as that is the focus of the second part of the code. If you get to know its name, I might be able to help you manipulate it. On the other hand, I might be way off base as to what we're looking at. Speaking of which, you should insert your images in your post instead of asking us to go to external sources. Some here won't, and some can't because of the environment they're in. I'm leery on accessing databases from external sources but usually will check out an image.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    I have confirmed it is a custom menu bar. When I look at one of my form properties under All, "Menu Bar" has the title "Custom Menu" listed.

  8. #8
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    That sounds like a system assigned reference rather than the menu name. If it is the name, it's just another example of using a poor or no naming convention. Anyway, create a module for the exploratory work on this so that your existing ones don't get polluted. Then add this to it and run it. If it chokes, note where and what the error message is and post that info. The following is to see if that is a valid name for the menu

    Code:
    Sub IterateCbars()
    Dim cb As CommandBar
    
    Set cb = CommandBars!("Custom Menu")
    Debug.Print cb.Controls.Item(1).Caption
    End Sub
    Regardless of how this goes, it will take me some time to review my old code and adapt it to suit your purpose. I've forgotten most of the object model for commandbars, so if you can't wait, please advise so I don't waste time on this. I've got some woodworking to do (Christmas!) so I will only be able to spend most of my time on this in the evenings.

  9. #9
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    On this line
    Code:
    Dim cb As CommandBar
    I get an error of 'user defined type not defined'

    And I appreciate any help you can give! I have to get this figured out, and it's above my head so I'll greatly wait

  10. #10
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    Msg sounds like a missing reference. Try adding a few like Office or whatever looks good. I'm out for the night so I can't check which one you might be missing.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  11. #11
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    Maybe it would be easier if you zipped a copy of the db and posted it here? You could remove sensitive data (maybe even all of it).

  12. #12
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    Upon re-reading your first post, I'm not sure what it is you want to do - modify the add-in menubar within the add-in, or control what is displayed on the bar from within the app that uses it. I've never used a custom bar as an add-in, only bars that were part of the db that uses them so if it is the latter, this will be somewhat of an experiment.

    I removed my reference to Office (12) and got the same error, so you are likely missing a reference to your version of Office. With the db open in shift bypass (design) mode, look in the vb editor (alt+F11) under Tools > References and add the reference to the Office library.

    P.S. If you have posted this problem another forum (or even this one) you need to declare that now.

  13. #13
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    @Micron - thank you for the help. To answer your ?, no this question has not been posted on any other forum, nor in a different thread on this forum. This is it

    I added a reference to Microsoft Office 15 and tried to run the syntax, and this time I get an error of
    'Type-declaration character does not match declared data type'

    On this line
    Code:
    CommandBars!

  14. #14
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    I figured quotes would be needed around what you think is the menu bar name because of the space, which is what I alluded to about naming. That seems to be the issue now. You could try it as
    Set cb = CommandBars!Custom Menu, or CommandBars![Custom Menu]
    and see what happens. Since an earlier post, I figured out how to iterate through the menus, so you could try that, looking for the name you think this menu bar is called.
    Code:
    Sub IterateCbars()
    Dim cb As CommandBar
    
    For Each cb In CommandBars
    Debug.Print cb.Name
    Next
    
    End Sub
    You will probably get a list in the immediate window of 100 or so application menu bars (at least I did). Look carefully through the list for Custom Menu. I missed mine (mnuMain) the first time.

    Re: the posting - thanks. I didn't want to dedicate a lot of time figuring this out if there was a chance it was cross posted elsewhere and maybe even solved there. I will let you know if I hit a brick wall and can't take it any further.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  15. #15
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    YES!! This produces the name of the menu bar that I am after!

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. block or remove all menus Access To Start?
    By clebergyn in forum Access
    Replies: 4
    Last Post: 06-25-2014, 06:19 PM
  2. VBA code menus
    By redbull in forum Programming
    Replies: 2
    Last Post: 08-13-2012, 02:41 PM
  3. Permantely disable MS Access Menus
    By alsaf in forum Programming
    Replies: 2
    Last Post: 12-09-2011, 01:56 PM
  4. Access Menus
    By FadingAPE in forum Access
    Replies: 5
    Last Post: 11-16-2010, 09:11 AM
  5. Hidden all of Microsoft Access Menus.
    By todaytips in forum Access
    Replies: 0
    Last Post: 10-28-2008, 08:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums