Subform Shortcut Menu

Henry Vandersteen
Henry Vandersteen used Ask the Experts™
on
Hi all

I'm using Access 2003
I have a form with a subform (datasheet)

I created a shorcut menu, lets call it myMenu, with only Sort Asc and Sort Desc in it that I want the user to use in the subform

In that form I selected ShortCut Menu = Yes and and selected the menu I created in the Shortcut Menu bar property

I tested it by opening the datasheet subform only and it works fine

However I noticed that you have to in the main form also select ShortCut Menu = Yes.
Once I do that if the user right clicks on a column in the subform he gets the full entries, not just what I created.

It makes no difference if I select my myMenu in the main form or not, I still get all the entries which is wrong

What needs to be done so the user only sees the myMenu entries I created?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
Does this have to be a subform?
You can open the subform alone, but still linked to the main form.

From the main form do something like this on a button to open the related records on the second ("sub") form
(Ex. Customers and Orders)

    DoCmd.OpenForm "frmOrders", , , "CustomerID=" & Me.CustomerID

JeffCoachman

Author

Commented:
Hi Jeff
Yes , the main form and subform need to display together. The main form has filtering capabilities etc
It just makes for an easier interface for the user
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
OK.

Then wait form another Expert then, I don't have Acc2003 installed on my computer anymore...

It just may be that the Shortcuts will only work in standalone forms
How to Generate Services Revenue the Easiest Way

This Tuesday! Learn key insights about modern cyber protection services & gain practical strategies to skyrocket business:

- What it takes to build a cloud service portfolio
- How to determine which services will help your unique business grow
- Various use-cases and examples

Database Architect / Application Developer
Top Expert 2007
Commented:
I've had a lot of experience with custom menus and shortcuts.  I cannot reproduce your issue.

I have a Main Form with ShortcutMenu set to No, and a Subform datasheet with ShortcutMenu set to Yes ... and a custom shortcut menu specified.

Right clicking over the subform, I get the custom menu.  Right clicking over the Main form, I get nothing ... as expected.

Can you upload your db ?

mx



Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
Thanks Joe, I don't have Acc2003 here.
And I never used the exact same set up as the OP.

I'll let you take it form here...


;-)

Jeff
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
Top Expert 2007

Commented:
s/b working ....

Author

Commented:
Hi guys,
Thanks for your responses
I have some more info about this issue.

I did as mx suggested. It is true that if I say No to ShortCut menu on the main form and Yes on the subform, with MyMenu selected, if I right click on any cell in the subform MyMenu comes up....great that works fine.

However, what I also noticed is that if I right clik any subform column header, the full Shortcut menu comes up. This is what I dont want. I dont want the user to be able to choose anything other than whats in MyMenu.

Seems rather odd isnt it. Why would clicking the column header be any different that clicking the cell of the datasheet?

Any thoughts?

Thanks
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
Top Expert 2007

Commented:
"what I also noticed is that if I right clik any subform column header,"
I am very aware of that, and as I recall,, I have never found a way to eliminate that Shortcut menu AND keep the custom one.

Now that I think about it, the only thing that comes to mind is that it might be possible to disable that column header sc menu in code ... IF, you can find the number of it in the CommandBars object.

mx

Author

Commented:
HI MX

OK , I'll try that. I'm going to award you the points since your other input got me to this point

Thanks again

Author

Commented:
This comment led to an other possible solution
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
Top Expert 2007

Commented:
Take a look at this:

"CommandBars.zip is a database containing functions to allow you to view all of the MS Office CommandBar objects and CommandBarControl objects on your system."

http://www.lebans.com/commandbars.htm

This will list all the commandbars in your db.  You should be able to get the ID to that specific command bar.  I would suggest creating a new db, with one datasheet view Form, with some table connected to it.  Then, import the commandbar lister a see what it shows.  So, the idea  is a real simple db to eliminate cutter, and see if it shows the datasheet commandbar.

mx

Author

Commented:
Hey thats great!

Thanks MX

Henry
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
Top Expert 2007

Commented:
Post back your results if you would.  I will try to mess with this later also.

mx

Author

Commented:
Ok will do

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial