DYNAMIC Short Cut Menu

GUIDO22

Registered User.
Local time
Today, 19:09
Joined
Nov 2, 2003
Messages
515
I am using Access 2003 and have a custom shortcut menu. I wish to add some entries to this shortcut menu dynamically.

Background : I am displaying a list of customer orders and wish to offer the user the facility to filter the search for one item instead of the default of ALL.

The dynamic entries would be the unique order item reference nos. retrived for that particular customer retrieved via recordset .
So the menu would show :

ALL
------
Model 1
Model 2
Model 3
etc.
...


how am I able to add these entries to the menu, the selection text will be the filter text I use to report upon.

Thanks for any help you can give.
 
There is a sample in the samples forum that builds the menu based on records in a table. I believe ChrisO posted it some time ago. Thats probably a good place to look.
 
There is a sample in the samples forum that builds the menu based on records in a table. I believe ChrisO posted it some time ago. Thats probably a good place to look.

I have searched in the Samples Database area - perhaps it is stored under something other than DYNAMIC or SHORT CUT MENU.... if anyone can qualify specifically where this reference is, perhaps you could let me know, t'would be a great help. Thank you.
 
Here. Good luck.

Also, I love your signature!

Thanks for the link - but if I run the 'as downloaded' file - it doesnt run.
(The project compiles fine)
Also, if I EARLY bind in using the MS Office 11. Object Library (as stated in the code module)- same error results...

"The expression OnOpen you entered as the event property setting produced the following error : Object or Class does not support the set of events."
 
I'm not sure what your problem is. It works fine for me.
 
Are you able to let me know what references are included when you open the database on your setup please...?

I have 3 only..
Visual Basic for Applications
MS Access 12.0 Object Lib
MS Office 11.0 Object Lib

Thanks
 
I've only got the first two.

What do you mean by this?
Thanks for the link - but if I run the 'as downloaded' file - it doesnt run.
 
(...By 'downloaded file' I was simply referring to the SAMPLE DATABASE!)

I have successfully loaded the database at my work PC, so can use this as foundation for what I have in mind.

Thank you very much for your help here, a great help.
 
Having been able to work through the code - it seems that the sample does not actually fully meet with what I was attempting to do.
The sample database advised, relies upon having a shortcut menu definition on the toolbar with full menu structure in place.... by definition this database uses a STATIC menu.

What I am trying to do, is DYNAMICALLY add items to the shortcut menu.
So as an example: a CUSTOMER has a number of PRODUCTS on ORDER.
When I select the customer from a list, the shortcut menu will appear and be populated with the Unique product identifiers. (Selection of one of these product ids will display a report specific to the ID choosen....)
 
I would hardly call it static. The menu you see in that sample is pulled from the tables. If you change the tables, you will see a change in the shortcut menus. This change in the menus can be instant if you make the code run again.

Also, this sample is only a framework for what you are trying to accomplish. It will probably take some effort to adapt the sample for your needs.
 
GUIDO22.

The Shortcut Menu Bar in that demo is dynamic in as much as it is deleted and recreated on each call.

You can see it in the code:-
Code:
[color=green]' Delete the Shortcut Menu if it already exists.[/color]
Application.CommandBars(CStr(!ShortcutName)).Delete

[color=green]' Make a new Shortcut Menu by the same name.[/color]
Set objCB = CommandBars.Add(Name:=CStr(!ShortcutName), Position:=5)

However, if you want the entries in the Shortcut Menu Bar to be dynamic, based on some user selection, you will need to base the build of the Shortcut Menu Bar on a Recordset limited to that selection.

Chris.
 

Users who are viewing this thread

Back
Top Bottom