Solved

Adding Run Query to Context Menu Access 2010

Posted on 2013-05-16
7
394 Views
Last Modified: 2013-05-17
I have a form in Access 2010 which is used for Timetable planning in a college. When assigning teaching staff to a particular slot it is useful for the planner to know how many periods that member of staff is already assigned to.
I've written a query which will list members of staff and the number of periods which they are teaching, but I would like for the user to be able to right click on a period and run the query filtered by the member of staff in the relevant period. For example, RDR is teaching a Maths class in period 1, so his initials are in the text box for period 1. The user right clicks on the period 1 text box, and selects "Query teacher" and this opens the query filtered for RDR.

How easy is this to do?
0
Comment
Question by:Karl_mark
  • 4
  • 2
7 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39171571
Right click menus are more difficult to create.

Why not just run this by clicking a button? (Much simpler)
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39171579
or simpler, display the results in a popup form in a listbox (to disallow edits)
0
 

Author Comment

by:Karl_mark
ID: 39171580
I've done that bit. It would just be nice to be able to right click and open the query!
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39171620
Then something like this should work in the most basic sense
Database107.mdb
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39171629
ooops, you wanted the right click...
...as I stated, these are trickier to make in Access 2010...

Let's see if another expert chimes in...
0
 
LVL 21

Accepted Solution

by:
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 500 total points
ID: 39173424
You can use VBA code to do what you want.

Attached is an example in 2003 format that will work in 2007 and later. It will show you how to do what you want.
ShortcutDemoForPosting-A2003.zip
0
 

Author Closing Comment

by:Karl_mark
ID: 39173917
Thanks. Looks like it does the job and I can work it out!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now