By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,510 Members | 1,451 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,510 IT Pros & Developers. It's quick & easy.

Runtime-determined ShortcutMenus, best course of action

P: n/a
My Customers/Sales/Contacts management database interface is modeled
as if Customers are objects, Sales are objects owned by Customer
objects, etc. (I'm running Access 11)

I have Listviews located just about everywhere for the purpose of
finding/acting on these objects.

I want to design a coherent model to handle contextual popup (shortcut
menus) for the different kinds of objects that will be clicked on.
Each object will (naturally) have different methods that apply
(Customers: Print mailing envelope, Sales: View PO, etc). These
objects and their methods are mapped in a few "meta-tables" in my
BE.

I should note, these object-specific menu-items will coinhabit the
Shortcut Menu with a few global menu items (Open, Delete, etc).

So far, after reading around on MSDN, it looks like I have two general
options (although I could be missing something):

1) Create the toolbars manually in design-mode, as Shortcut menus,
mirroring the data I have in the BE. Then, before I show the popup at
runtime, copy the object-centric shortcutmenu onto the "Global menu."

2) Mash up each toolbar at runtime, creating each menu item by reading
the relevant data from the BE tables.

Does anyone have experience with the kind of thing? What would you
do?

Also, when you create a command bar (or copy items onto one), what is
its scope? Does it persist absolutely, per session, per sub-routine?

Any pointers are appreciated.
Dec 18 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"JohnH" <Jo**********@gmail.comwrote in message
news:92**********************************@s8g2000p rg.googlegroups.com...
My Customers/Sales/Contacts management database interface is modeled
as if Customers are objects, Sales are objects owned by Customer
objects, etc. (I'm running Access 11)

I have Listviews located just about everywhere for the purpose of
finding/acting on these objects.

I want to design a coherent model to handle contextual popup (shortcut
menus) for the different kinds of objects that will be clicked on.
Each object will (naturally) have different methods that apply
(Customers: Print mailing envelope, Sales: View PO, etc). These
objects and their methods are mapped in a few "meta-tables" in my
BE.

I should note, these object-specific menu-items will coinhabit the
Shortcut Menu with a few global menu items (Open, Delete, etc).

So far, after reading around on MSDN, it looks like I have two general
options (although I could be missing something):

1) Create the toolbars manually in design-mode, as Shortcut menus,
mirroring the data I have in the BE. Then, before I show the popup at
runtime, copy the object-centric shortcutmenu onto the "Global menu."

2) Mash up each toolbar at runtime, creating each menu item by reading
the relevant data from the BE tables.

Does anyone have experience with the kind of thing? What would you
do?

Also, when you create a command bar (or copy items onto one), what is
its scope? Does it persist absolutely, per session, per sub-routine?

Any pointers are appreciated.
When you say Listview, do you mean the Activex listview control? I ask
because if you mean an Access listbox then you can create the menu at design
time and set the listbox's Shortcut menu bar property to the name of your
menu.

If (as I suspect) you do mean a Listview control, I'd probably go with your
option 2, because in my experience, the menus can be built quite quickly in
code.

As to your 2nd question re persistence, commandbars can be made to have
cross-session persistence, ie they can survive a database restart. When you
use the CommandBars.Add method, set the 'Temporary' parameter to False.
Dec 18 '07 #2

P: n/a
On Dec 18, 2:46 pm, "Stuart McCall" <smcc...@myunrealbox.comwrote:
"JohnH" <JohnHarri...@gmail.comwrote in message

news:92**********************************@s8g2000p rg.googlegroups.com...
My Customers/Sales/Contacts management database interface is modeled
as if Customers are objects, Sales are objects owned by Customer
objects, etc. (I'm running Access 11)
I have Listviews located just about everywhere for the purpose of
finding/acting on these objects.
I want to design a coherent model to handle contextual popup (shortcut
menus) for the different kinds of objects that will be clicked on.
Each object will (naturally) have different methods that apply
(Customers: Print mailing envelope, Sales: View PO, etc). These
objects and their methods are mapped in a few "meta-tables" in my
BE.
I should note, these object-specific menu-items will coinhabit the
Shortcut Menu with a few global menu items (Open, Delete, etc).
So far, after reading around on MSDN, it looks like I have two general
options (although I could be missing something):
1) Create the toolbars manually in design-mode, as Shortcut menus,
mirroring the data I have in the BE. Then, before I show the popup at
runtime, copy the object-centric shortcutmenu onto the "Global menu."
2) Mash up each toolbar at runtime, creating each menu item by reading
the relevant data from the BE tables.
Does anyone have experience with the kind of thing? What would you
do?
Also, when you create a command bar (or copy items onto one), what is
its scope? Does it persist absolutely, per session, per sub-routine?
Any pointers are appreciated.

When you say Listview, do you mean the Activex listview control? I ask
because if you mean an Access listbox then you can create the menu at design
time and set the listbox's Shortcut menu bar property to the name of your
menu.

If (as I suspect) you do mean a Listview control, I'd probably go with your
option 2, because in my experience, the menus can be built quite quickly in
code.

As to your 2nd question re persistence, commandbars can be made to have
cross-session persistence, ie they can survive a database restart. When you
use the CommandBars.Add method, set the 'Temporary' parameter to False.
Yes I did mean the activex listview.

Thank you for your concise and helpful direction. I'm going to try to
get it working today.
Dec 19 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.