473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to show custom shortcut menu for PivotCharts but no where else?

374 256MB
Hi all,

I have been playing with pivotcharts lately to display my data from my database. I have since found however that I will need to get rid of a lot of the "options" a user has to mess around with when I distribute out my database.

One of the easiest ways to do this has been to disable all menus and shortcut menus in my database using the startup properties. However I lose functionality in my pivot charts, namely the drill down / drill out / expand / collapse in the default shortcut menu.

I have found I can create my own and I have added the above functionality to my custom shortcut menu.

Now my issue is I have tried adding this menu to the forms properties but it still does not show.

Is this because of my startup options being incorrect?

How do I go about disabling all shortcuts/menus in my database but then allowing one to open for my pivot charts? Would creating a blank shortcut menu for all other forms do the trick and how would I go about enabling my other menu when I am on certain forms.
Jan 27 '11 #1
3 2505
munkee
374 256MB
Ok I have partially got this working (I created a custom shortcut menu) but I have a new issue.

When I open my subform up directly (which is set to pivotchart view) My menu works fine.

However when I open up my main form which displays this pivotchart within a subform my menu doesnt work... any ideas?

I have attached some images to show.
Attached Images
File Type: jpg notworking.jpg (33.0 KB, 226 views)
File Type: jpg setup.jpg (30.0 KB, 217 views)
File Type: jpg working.jpg (33.9 KB, 198 views)
Jan 27 '11 #2
munkee
374 256MB
I have done some more messing by creating a toolbar menu as well to confirm the action isnt just a issue with the shortcut menu I made when I right click.

What happens is when I click into the subforms pivot chart and select a series or a text name on the x-axis that would normally allow a drilldown I get no options in my menus, they are all greyed out.

However if I allow my right click to popup the default menu and then do the same action I get the options popup on the default menu, without them being greyed out. I also see that my custom toolbar is now showing the options being available too.

In my limited experience this is clearly showing some form of focus issue with the selection. I need to somehow work out what the default menu is doing differently before opening compared to my custom menu...

any ideas on this?
Jan 28 '11 #3
munkee
374 256MB
OK I ditched the idea of my own custom menu as there was far to much headache in trying to figure out what was causing the focus issues.

Instead I did a lot of research into disabling menu controls. Long story short I have some very disgustingly ugly code.. that works.

Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2. Option Compare Database
  3.  
  4. Private Sub Form_Close()
  5. Dim myControls As CommandBarControls
  6. Dim ctl As CommandBarControl
  7. Dim mykilling As CommandBarControls
  8. Dim byechart As CommandBarControls
  9. Dim byefilter As CommandBarControls
  10. Dim byecalc As CommandBarControls
  11.  
  12.     Set myControls = CommandBars.FindControls _
  13.         (Type:=msoControlButton, Id:=501)    'field list
  14.  
  15.     Set mykilling = CommandBars.FindControls(msoControlButton, 222) ' properties
  16.     Set byechart = CommandBars.FindControls(msoControlButton, 6450) 'chart
  17.       Set byefilter = CommandBars.FindControls(msoControlButton, 5884) 'filter
  18.  Set byecalc = CommandBars.FindControls(msoControlButtonPopup, 6700) 'calc
  19.  
  20.  
  21.     For Each ctl In myControls
  22.         ctl.Visible = True
  23.  
  24.     Next ctl
  25.  
  26.     For Each ctl In mykilling
  27.         ctl.Visible = True
  28.  
  29.     Next ctl
  30.  
  31.     For Each ctl In byechart
  32.         ctl.Visible = True
  33.  
  34.     Next ctl
  35.  
  36.   For Each ctl In byefilter
  37.         ctl.Visible = True
  38.  
  39.     Next ctl
  40.  
  41.     For Each ctl In byecalc
  42.     ctl.Visible = True
  43.     Next ctl
  44. End Sub
  45.  
  46. Private Sub Form_Open(Cancel As Integer)
  47. Dim myControls As CommandBarControls
  48. Dim ctl As CommandBarControl
  49. Dim mykilling As CommandBarControls
  50. Dim byechart As CommandBarControls
  51. Dim byefilter As CommandBarControls
  52. Dim byecalc As CommandBarControls
  53.  
  54.     Set myControls = CommandBars.FindControls _
  55.         (Type:=msoControlButton, Id:=501)    'field list
  56.  
  57.     Set mykilling = CommandBars.FindControls(msoControlButton, 222) ' properties
  58.     Set byechart = CommandBars.FindControls(msoControlButton, 6450) 'chart
  59.       Set byefilter = CommandBars.FindControls(msoControlButton, 5884) 'filter
  60.  Set byecalc = CommandBars.FindControls(msoControlButtonPopup, 6700) 'calc
  61.  
  62.  
  63.     For Each ctl In myControls
  64.         ctl.Visible = False
  65.  
  66.     Next ctl
  67.  
  68.     For Each ctl In mykilling
  69.         ctl.Visible = False
  70.  
  71.     Next ctl
  72.  
  73.     For Each ctl In byechart
  74.         ctl.Visible = False
  75.  
  76.     Next ctl
  77.  
  78.   For Each ctl In byefilter
  79.         ctl.Visible = False
  80.  
  81.     Next ctl
  82.  
  83.     For Each ctl In byecalc
  84.     ctl.Visible = False
  85.     Next ctl
  86. End Sub
  87.  
  88.  
  89.  
No error handling as of yet.. but I expect it to suck.
Jan 28 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Lex | last post by:
I am writing a C# app that has a Menu. Some of the menu items will have short cuts that do not exist in the Shortcut enum. I would like the custom shortcuts to appear on the menu but as far as I...
3
by: Terry Bell | last post by:
I have some code that adds entries to the "Module Compiled" popup menu. Works fine in A97. You can open a module, right click, and the new entries are there for you to click. I converted it to...
2
by: JMCN | last post by:
hi i'm having a problem with the customize a shortcut menu. i read the ms office assistance: customize a shortcut menu/delete a command or add to a shortcut menu and followed the simple...
5
by: Steven | last post by:
I have some text boxes on a form in MS Access 2000. When I right click in them I don't get any shortcut menu at all. I want the normal cut, copy, and past menu to come up. In the "Startup", I...
12
by: downwitch | last post by:
Hi all, I've read through the archives on this, and scoured the web, to little avail. There has to be a way to move custom menu bars (or menubars, or command bars, or popup command bars, or...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.