Adding an item into Access menu under Add-In tab

-- -- 957 Reputation points
2022-11-28T21:25:36.437+00:00

Hi

I have a menu from Access 2000 days which appears under Add-In tab. How can I add additional items to this menu such as new Access reports? Can I do it programmatically?

I have tried

      Dim msoControlButton, newItem  
        
      msoControlButton = 1  
        
          Set newItem = CommandBars("Main Toolbar").Controls("Reports").Add(Type:=msoControlButton)  
    With newItem  
        .BeginGroup = True  
        .Caption = "Client Forecast - Quote"  
        .FaceID = 0  
        .OnAction = "Date Range Forecast - Quote"  
    End With  

but it says 'Object doesn't support this property or method' on line 5 above.

Thanks

Regards

264982-accessmenu.png

Microsoft 365 and Office Access Development
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Eugene Astafiev 891 Reputation points
    2022-11-29T10:43:08.877+00:00

    CommandBars were deprecated and shouldn't be used for customizing the ribbon UI any longer. Instead, you need to use the Fluent UI (aka Ribbon UI). Read more about the Fluent UI in the following series of articles:

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.