Solved

Adding Run Query to Context Menu Access 2010

Posted on 2013-05-16
7
407 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

Back Up Your Microsoft Windows Server®

Back up 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.

Question has a verified solution.

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

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…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

778 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