Solved

Adding Run Query to Context Menu Access 2010

Posted on 2013-05-16
7
412 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

791 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